├── .gitignore ├── CMakeLists.txt ├── COPYING ├── README.md ├── flatpak └── cn.fmsoft.xGUIPro.yml └── source ├── CMakeLists.txt ├── bin ├── CMakeLists.txt ├── MyMacros.cmake ├── PlatformGTK.cmake ├── PlatformMiniGUI.cmake ├── gtk │ ├── BrowserCellRendererVariant.c │ ├── BrowserCellRendererVariant.h │ ├── BrowserDownloadsBar.c │ ├── BrowserDownloadsBar.h │ ├── BrowserPane.c │ ├── BrowserPane.h │ ├── BrowserPlainWindow.c │ ├── BrowserPlainWindow.h │ ├── BrowserSearchBox.c │ ├── BrowserSearchBox.h │ ├── BrowserSettingsDialog.c │ ├── BrowserSettingsDialog.h │ ├── BrowserTab.c │ ├── BrowserTab.h │ ├── BrowserTabbedWindow.c │ ├── BrowserTabbedWindow.h │ ├── BrowserWindow.c │ ├── BrowserWindow.h │ ├── BuildRevision.h.in │ ├── FloatingWindow.c │ ├── FloatingWindow.h │ ├── LayouterWidgets.c │ ├── LayouterWidgets.h │ ├── PurcmcCallbacks.c │ ├── PurcmcCallbacks.h │ ├── browser-marshal.list │ ├── main.c │ └── main.h ├── layout-panes.html ├── layouter │ ├── dom-ops.c │ ├── dom-ops.h │ ├── layouter.c │ └── layouter.h ├── minigui │ ├── BrowserLayoutContainer.c │ ├── BrowserLayoutContainer.h │ ├── BrowserPane.c │ ├── BrowserPane.h │ ├── BrowserPaneContainer.c │ ├── BrowserPaneContainer.h │ ├── BrowserPlainWindow.c │ ├── BrowserPlainWindow.h │ ├── BrowserTab.c │ ├── BrowserTab.h │ ├── BrowserTabContainer.c │ ├── BrowserTabContainer.h │ ├── BrowserTabbedWindow.c │ ├── BrowserTabbedWindow.h │ ├── BuildRevision.h.in │ ├── Common.c │ ├── Common.h │ ├── FloatingToolWindow.c │ ├── FloatingToolWindow.h │ ├── FloatingWindow.c │ ├── FloatingWindow.h │ ├── LayouterWidgets.c │ ├── LayouterWidgets.h │ ├── PurcmcCallbacks.c │ ├── PurcmcCallbacks.h │ ├── SwitchRendererWindow.c │ ├── SwitchRendererWindow.h │ ├── browser-marshal.list │ ├── main.c │ └── main.h ├── purcmc │ ├── endpoint.c │ ├── endpoint.h │ ├── purcmc.h │ ├── server.c │ ├── server.h │ ├── unixsocket.c │ ├── unixsocket.h │ ├── websocket.c │ └── websocket.h ├── schema │ ├── HVMLURISchema.c │ ├── HVMLURISchema.h │ ├── HbdrunURISchema.c │ └── HbdrunURISchema.h ├── sd │ ├── sd.c │ └── sd.h ├── test_layouter.c ├── test_layouter.html ├── utils │ ├── hbdrun-uri.c │ ├── hbdrun-uri.h │ ├── utils.c │ └── utils.h ├── webext │ ├── CMakeLists.txt │ ├── PlatformGTK.cmake │ ├── PlatformMiniGUI.cmake │ ├── assets │ │ ├── about.html.in │ │ ├── arrow-left.png │ │ ├── arrow-right.png │ │ ├── bootstrap-5.1.3-dist.zip │ │ ├── bootstrap-5.3.1-dist.zip │ │ ├── bootstrap-icons-1.10.5.zip │ │ ├── bootstrap-icons-1.8.3.zip │ │ ├── favicon.ico │ │ ├── home.png │ │ ├── hvml-dark-h240.png │ │ ├── hvml-dark.png │ │ ├── hvml-light-h240.png │ │ ├── hvml-light.png │ │ ├── hvml-v-black.png │ │ ├── hvml-v-fill-white.png │ │ ├── hvml-v-fill.svg │ │ ├── hvml-v.png │ │ ├── hvml-v.svg │ │ ├── hvml.js.in │ │ ├── hvml.png │ │ ├── screen-cast.png │ │ ├── splash.jpg │ │ ├── toggle.png │ │ └── workspace-layouter.css │ ├── glib │ │ └── WebExtensionHVML.c │ ├── log.c │ └── log.h ├── xguipro-features.h.in └── xguipro-version.h.in ├── cmake ├── BubblewrapSandboxChecks.cmake ├── DetectSSE2.cmake ├── FindCairoHBD.cmake ├── FindDOMRuler.cmake ├── FindGLIB.cmake ├── FindGObjectIntrospection.cmake ├── FindGTK.cmake ├── FindGperf.cmake ├── FindLibGcrypt.cmake ├── FindLibNotify.cmake ├── FindLibPSL.cmake ├── FindLibSoup.cmake ├── FindLibseccomp.cmake ├── FindLibsecret.cmake ├── FindLibtasn1.cmake ├── FindManette.cmake ├── FindMiniGUI.cmake ├── FindMySQLClient.cmake ├── FindNcurses.cmake ├── FindNghttp2.cmake ├── FindPerlModules.cmake ├── FindPurC.cmake ├── FindSQLite3.cmake ├── FindSystemd.cmake ├── FindThunder.cmake ├── FindWebKit2Gtk.cmake ├── FindWebKit2HBD.cmake ├── GlobalCCache.cmake ├── GlobalCommon.cmake ├── GlobalCompilerFlags.cmake ├── GlobalDist.cmake ├── GlobalFS.cmake ├── GlobalFeatures.cmake ├── GlobalFindPackage.cmake ├── GlobalMacros.cmake ├── GlobalPackaging.cmake ├── GlobalStaticAnalysis.cmake ├── GtkDoc.cmake ├── OptionsAppleWin.cmake ├── OptionsCommon.cmake ├── OptionsGTK.cmake ├── OptionsMSVC.cmake ├── OptionsMac.cmake ├── OptionsMiniGUI.cmake ├── OptionsWin.cmake ├── OptionsWindows.cmake ├── VersioningUtils.cmake ├── WinTools.make └── target │ └── xGUIPro.cmake ├── lib ├── CMakeLists.txt ├── MyMacros.cmake ├── PlatformGTK.cmake ├── PlatformMac.cmake ├── PlatformMiniGUI.cmake ├── Sources.txt ├── config.h └── utils │ ├── avl-cmp.c │ ├── avl-cmp.h │ ├── avl.c │ ├── avl.h │ ├── base64-alloc.c │ ├── base64.h │ ├── gslist.c │ ├── gslist.h │ ├── hvml-uri.c │ ├── hvml-uri.h │ ├── kvlist.c │ ├── kvlist.h │ ├── list.h │ ├── load-asset.c │ ├── load-asset.h │ ├── misc.c │ ├── misc.h │ ├── sha1.c │ ├── sha1.h │ ├── sorted-array.c │ └── sorted-array.h ├── tools ├── aur │ ├── README.md │ ├── xguipro-git │ │ └── PKGBUILD │ └── xguipro │ │ └── PKGBUILD └── debian │ ├── changelog │ ├── control │ ├── copyright │ ├── rules │ └── source │ └── format └── wtf ├── CMakeLists.txt ├── MyMacros.cmake └── wtf ├── CMakeLists.txt ├── Compiler.h ├── ExportMacros.h ├── Platform.h ├── PlatformCPU.h ├── PlatformCallingConventions.h ├── PlatformEnable.h ├── PlatformHave.h ├── PlatformLegacy.h ├── PlatformOS.h ├── PlatformRegisters.h ├── PlatformUse.h ├── TLSKeyword.h.in └── nothing.c /.gitignore: -------------------------------------------------------------------------------- 1 | build*/ 2 | 3 | # local .vimrc 4 | .vimrc 5 | *.swp 6 | 7 | .build/ 8 | 9 | # CMake 10 | cmake-build-*/ 11 | CMakeLists.txt.user 12 | CMakeCache.txt 13 | CMakeFiles 14 | CMakeScripts 15 | Testing 16 | Makefile 17 | cmake_install.cmake 18 | install_manifest.txt 19 | compile_commands.json 20 | CTestTestfile.cmake 21 | _deps 22 | *_include.cmake 23 | *_tests.cmake 24 | 25 | # test 26 | -------------------------------------------------------------------------------- /flatpak/cn.fmsoft.xGUIPro.yml: -------------------------------------------------------------------------------- 1 | app-id: cn.fmsoft.xGUIPro 2 | runtime: org.gnome.Platform 3 | runtime-version: '44' 4 | sdk: org.gnome.Sdk 5 | command: xgui-pro 6 | 7 | finish-args: 8 | # X11 + XShm access 9 | - --share=ipc 10 | - --socket=fallback-x11 11 | # Wayland access 12 | - --socket=wayland 13 | # GPU acceleration if needed 14 | - --device=dri 15 | # Needs to talk to the network: 16 | - --share=network 17 | # Needs to save files locally 18 | - --filesystem=xdg-documents 19 | 20 | cleanup: 21 | # - '/include' 22 | - '*.a' 23 | 24 | modules: 25 | - name: WebKit 26 | buildsystem: cmake 27 | config-opts: 28 | - -DPORT=GTK 29 | - -DCMAKE_BUILD_TYPE=RelWithDebInfo 30 | - -DENABLE_GAMEPAD=OFF 31 | - -DENABLE_INTROSPECTION=OFF 32 | - -DUSE_SOUP2=OFF 33 | - -DUSE_WPE_RENDERER=OFF 34 | - -DUSE_LCMS=OFF 35 | sources: 36 | - type: archive 37 | url: file:///srv/build/sources/WebKitHBD-2.34.1-20231116-075505-Source.tar.xz 38 | archive-type: tar-xz 39 | sha256: 01d27dd7f19425d739902fd1e6cdb39a2ef400d0e1064a9cf074e38d3823992a 40 | 41 | - name: PurC 42 | buildsystem: cmake 43 | config-opts: 44 | - -DPORT=Linux 45 | - -DCMAKE_BUILD_TYPE=RelWithDebInfo 46 | - -DENABLE_REMOTE_FETCHER=OFF 47 | - -DENABLE_RENDERER_FOIL=OFF 48 | - -DENABLE_API_TESTS=OFF 49 | sources: 50 | - type: git 51 | path: /srv/build/hvml/purc/ 52 | branch: purcmc-160 53 | # tag: ver-0.9.16 54 | 55 | - name: xGUI-Pro 56 | buildsystem: cmake 57 | config-opts: 58 | - -DPORT=GTK 59 | - -DCMAKE_BUILD_TYPE=RelWithDebInfo 60 | - -DUSE_SOUP2=OFF 61 | sources: 62 | - type: git 63 | path: /srv/build/hvml/xgui-pro/ 64 | branch: main 65 | # tag: ver-0.9.16 66 | 67 | -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # Add components directories 3 | # ----------------------------------------------------------------------------- 4 | add_subdirectory(wtf) 5 | add_subdirectory(lib) 6 | add_subdirectory(bin) 7 | 8 | XGUIPRO_INCLUDE_CONFIG_FILES_IF_EXISTS() 9 | -------------------------------------------------------------------------------- /source/bin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_property(DIRECTORY . PROPERTY FOLDER "bin") 2 | 3 | include(GlobalCommon) 4 | include(target/xGUIPro) 5 | include(MyMacros.cmake) 6 | 7 | set(XGUIPRO_WEB_EXTENSIONS_OUTPUT_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/webext") 8 | set(XGUIPRO_WEB_EXTENSIONS_INSTALL_DIR "${LIB_INSTALL_DIR}/xguipro") 9 | 10 | configure_file(xguipro-version.h.in ${xGUIPro_DERIVED_SOURCES_DIR}/xguipro-version.h) 11 | configure_file(xguipro-features.h.in ${xGUIPro_DERIVED_SOURCES_DIR}/xguipro-features.h) 12 | 13 | add_subdirectory(webext) 14 | 15 | XGUIPRO_EXECUTABLE_DECLARE(xguipro) 16 | 17 | list(APPEND xguipro_PRIVATE_INCLUDE_DIRECTORIES 18 | "${CMAKE_BINARY_DIR}" 19 | "${xGUIPro_DERIVED_SOURCES_DIR}" 20 | "${XGUIPRO_LIB_DIR}" 21 | "${XGUIPRO_BIN_DIR}" 22 | ) 23 | 24 | list(APPEND xguipro_SYSTEM_INCLUDE_DIRECTORIES 25 | "${PurC_INCLUDE_DIR}" 26 | ) 27 | 28 | list(APPEND xguipro_DEFINITIONS 29 | ) 30 | 31 | XGUIPRO_EXECUTABLE(xguipro) 32 | 33 | set(xguipro_PLATFORM_INDEPENDENT_DIRS 34 | "purcmc" 35 | "layouter" 36 | "schema" 37 | "sd" 38 | "utils" 39 | ) 40 | 41 | APPEND_ALL_SOURCE_FILES_IN_DIRLIST(xguipro_SOURCES 42 | "${xguipro_PLATFORM_INDEPENDENT_DIRS}") 43 | 44 | list(APPEND xguipro_SOURCES 45 | ) 46 | 47 | set(xguipro_LIBRARIES 48 | xGUIPro::xGUIPro 49 | WebKit::JSC 50 | WebKit::WebKit 51 | DOMRuler::DOMRuler 52 | PurC::PurC 53 | pthread 54 | ) 55 | 56 | XGUIPRO_INCLUDE_CONFIG_FILES_IF_EXISTS() 57 | 58 | XGUIPRO_COMPUTE_SOURCES(xguipro) 59 | XGUIPRO_FRAMEWORK(xguipro) 60 | 61 | install(TARGETS xguipro DESTINATION "${EXEC_INSTALL_DIR}/") 62 | 63 | XGUIPRO_EXECUTABLE_DECLARE(test_layouter) 64 | 65 | list(APPEND test_layouter_PRIVATE_INCLUDE_DIRECTORIES 66 | "${CMAKE_BINARY_DIR}" 67 | "${xGUIPro_DERIVED_SOURCES_DIR}" 68 | "${XGUIPRO_LIB_DIR}" 69 | "${XGUIPRO_BIN_DIR}" 70 | ) 71 | 72 | list(APPEND test_layouter_SYSTEM_INCLUDE_DIRECTORIES 73 | "${GLIB_INCLUDE_DIRS}" 74 | "${PurC_INCLUDE_DIR}" 75 | ) 76 | 77 | list(APPEND test_layouter_DEFINITIONS 78 | ) 79 | 80 | XGUIPRO_EXECUTABLE(test_layouter) 81 | 82 | set(test_layouter_PLATFORM_INDEPENDENT_DIRS 83 | "layouter" 84 | ) 85 | 86 | APPEND_ALL_SOURCE_FILES_IN_DIRLIST(test_layouter_SOURCES 87 | "${test_layouter_PLATFORM_INDEPENDENT_DIRS}") 88 | 89 | list(APPEND test_layouter_SOURCES 90 | "test_layouter.c" 91 | ) 92 | 93 | set(test_layouter_LIBRARIES 94 | xGUIPro::xGUIPro 95 | DOMRuler::DOMRuler 96 | PurC::PurC 97 | pthread 98 | ) 99 | 100 | XGUIPRO_COMPUTE_SOURCES(test_layouter) 101 | XGUIPRO_FRAMEWORK(test_layouter) 102 | 103 | set(test_files_FILES 104 | "${CMAKE_BINARY_DIR}/test_layouter.html" 105 | ) 106 | 107 | set(test_files_SOURCES 108 | "layout-panes.html" 109 | "test_layouter.html" 110 | ) 111 | 112 | file(COPY ${test_files_SOURCES} DESTINATION "${CMAKE_BINARY_DIR}") 113 | 114 | add_custom_target(test_files DEPENDS ${test_files_FILES}) 115 | add_dependencies(test_layouter test_files) 116 | 117 | -------------------------------------------------------------------------------- /source/bin/MyMacros.cmake: -------------------------------------------------------------------------------- 1 | # Append the all C files in the specified directory list to the source list 2 | macro(APPEND_ALL_SOURCE_FILES_IN_DIRLIST result) 3 | set(filelist "") 4 | foreach(module ${ARGN}) 5 | list(APPEND filelist ${module}/*.c) 6 | list(APPEND filelist ${module}/*.cpp) 7 | endforeach() 8 | file(GLOB_RECURSE ${result} RELATIVE ${XGUIPRO_BIN_DIR} ${filelist}) 9 | # FOREACH(file ${${result}}) 10 | # message(STATUS ${file}) 11 | # ENDFOREACH() 12 | unset(filelist) 13 | endmacro() 14 | -------------------------------------------------------------------------------- /source/bin/PlatformGTK.cmake: -------------------------------------------------------------------------------- 1 | file(MAKE_DIRECTORY ${xGUIPro_DERIVED_SOURCES_DIR}/gtk) 2 | 3 | configure_file(gtk/BuildRevision.h.in ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BuildRevision.h) 4 | 5 | list(APPEND xguipro_PRIVATE_INCLUDE_DIRECTORIES 6 | "${xGUIPro_DERIVED_SOURCES_DIR}/gtk" 7 | ) 8 | 9 | list(APPEND xguipro_SYSTEM_INCLUDE_DIRECTORIES 10 | ${GLIB_INCLUDE_DIRS} 11 | ${LIBSOUP_INCLUDE_DIRS} 12 | ) 13 | 14 | list(APPEND xguipro_SOURCES 15 | ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BrowserMarshal.c 16 | gtk/BrowserCellRendererVariant.c 17 | gtk/BrowserCellRendererVariant.h 18 | gtk/BrowserDownloadsBar.c 19 | gtk/BrowserDownloadsBar.h 20 | gtk/BrowserSearchBox.c 21 | gtk/BrowserSearchBox.h 22 | gtk/BrowserSettingsDialog.c 23 | gtk/BrowserSettingsDialog.h 24 | gtk/BrowserTab.c 25 | gtk/BrowserTab.h 26 | gtk/BrowserPane.c 27 | gtk/BrowserPane.h 28 | gtk/BrowserWindow.c 29 | gtk/BrowserWindow.h 30 | gtk/BrowserPlainWindow.c 31 | gtk/BrowserPlainWindow.h 32 | gtk/BrowserTabbedWindow.c 33 | gtk/BrowserTabbedWindow.h 34 | gtk/PurcmcCallbacks.c 35 | gtk/PurcmcCallbacks.h 36 | gtk/LayouterWidgets.c 37 | gtk/LayouterWidgets.h 38 | gtk/FloatingWindow.h 39 | gtk/FloatingWindow.c 40 | gtk/main.c 41 | ) 42 | 43 | list(APPEND xguipro_LIBRARIES 44 | ${LIBSOUP_LIBRARIES} 45 | GTK::GTK 46 | ) 47 | 48 | if (HAVE_LIBSSL) 49 | list(APPEND xguipro_LIBRARIES ${OPENSSL_LIBRARIES}) 50 | endif (HAVE_LIBSSL) 51 | 52 | add_custom_command( 53 | OUTPUT ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BrowserMarshal.c 54 | ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BrowserMarshal.h 55 | MAIN_DEPENDENCY ${XGUIPRO_BIN_DIR}/gtk/browser-marshal.list 56 | COMMAND glib-genmarshal --prefix=browser_marshal ${XGUIPRO_BIN_DIR}/gtk/browser-marshal.list --body --skip-source > ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BrowserMarshal.c 57 | COMMAND glib-genmarshal --prefix=browser_marshal ${XGUIPRO_BIN_DIR}/gtk/browser-marshal.list --header --skip-source > ${xGUIPro_DERIVED_SOURCES_DIR}/gtk/BrowserMarshal.h 58 | VERBATIM) 59 | -------------------------------------------------------------------------------- /source/bin/PlatformMiniGUI.cmake: -------------------------------------------------------------------------------- 1 | file(MAKE_DIRECTORY ${xGUIPro_DERIVED_SOURCES_DIR}/minigui) 2 | 3 | configure_file(minigui/BuildRevision.h.in ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BuildRevision.h) 4 | 5 | list(APPEND xguipro_PRIVATE_INCLUDE_DIRECTORIES 6 | "${xGUIPro_DERIVED_SOURCES_DIR}/minigui" 7 | ) 8 | 9 | list(APPEND xguipro_SYSTEM_INCLUDE_DIRECTORIES 10 | ${GLIB_INCLUDE_DIRS} 11 | ${GIO_UNIX_INCLUDE_DIRS} 12 | ${LIBSOUP_INCLUDE_DIRS} 13 | ) 14 | 15 | list(APPEND xguipro_SOURCES 16 | ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BrowserMarshal.c 17 | minigui/Common.c 18 | minigui/BrowserTab.c 19 | minigui/BrowserTab.h 20 | minigui/BrowserPane.c 21 | minigui/BrowserPane.h 22 | minigui/BrowserPlainWindow.c 23 | minigui/BrowserPlainWindow.h 24 | minigui/BrowserTabbedWindow.c 25 | minigui/BrowserTabbedWindow.h 26 | minigui/BrowserLayoutContainer.h 27 | minigui/BrowserLayoutContainer.c 28 | minigui/BrowserPaneContainer.h 29 | minigui/BrowserPaneContainer.c 30 | minigui/BrowserTabContainer.h 31 | minigui/BrowserTabContainer.c 32 | minigui/PurcmcCallbacks.c 33 | minigui/PurcmcCallbacks.h 34 | minigui/LayouterWidgets.c 35 | minigui/LayouterWidgets.h 36 | minigui/main.c 37 | minigui/FloatingToolWindow.c 38 | minigui/FloatingWindow.c 39 | minigui/SwitchRendererWindow.c 40 | ) 41 | 42 | list(APPEND xguipro_LIBRARIES 43 | ${LIBSOUP_LIBRARIES} 44 | ${GLIB_GIO_LIBRARIES} 45 | ${GLIB_GOBJECT_LIBRARIES} 46 | ${GLIB_LIBRARIES} 47 | CairoHBD::CairoHBD 48 | MiniGUI::MiniGUI 49 | MiniGUI::mGEff 50 | ) 51 | 52 | if (HAVE_LIBSSL) 53 | list(APPEND xguipro_LIBRARIES ${OPENSSL_LIBRARIES}) 54 | endif (HAVE_LIBSSL) 55 | 56 | add_custom_command( 57 | OUTPUT ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BrowserMarshal.c 58 | ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BrowserMarshal.h 59 | MAIN_DEPENDENCY ${XGUIPRO_BIN_DIR}/minigui/browser-marshal.list 60 | COMMAND glib-genmarshal --prefix=browser_marshal ${XGUIPRO_BIN_DIR}/minigui/browser-marshal.list --body --skip-source > ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BrowserMarshal.c 61 | COMMAND glib-genmarshal --prefix=browser_marshal ${XGUIPRO_BIN_DIR}/minigui/browser-marshal.list --header --skip-source > ${xGUIPro_DERIVED_SOURCES_DIR}/minigui/BrowserMarshal.h 62 | VERBATIM) 63 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserCellRendererVariant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef BrowserCellRendererVariant_h 27 | #define BrowserCellRendererVariant_h 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define BROWSER_TYPE_CELL_RENDERER_VARIANT (browser_cell_renderer_variant_get_type()) 34 | #define BROWSER_CELL_RENDERER_VARIANT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_CELL_RENDERER_VARIANT, BrowserCellRendererVariant)) 35 | #define BROWSER_CELL_RENDERER_VARIANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_CELL_RENDERER_VARIANT, BrowserCellRendererVariantClass)) 36 | #define BROWSER_IS_CELL_RENDERER_VARIANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_CELL_RENDERER_VARIANT)) 37 | #define BROWSER_IS_CELL_RENDERER_VARIANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_CELL_RENDERER_VARIANT)) 38 | #define BROWSER_CELL_RENDERER_VARIANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_CELL_RENDERER_VARIANT, BrowserCellRendererVariantClass)) 39 | 40 | typedef struct _BrowserCellRendererVariant BrowserCellRendererVariant; 41 | typedef struct _BrowserCellRendererVariantClass BrowserCellRendererVariantClass; 42 | 43 | GType browser_cell_renderer_variant_get_type(void); 44 | 45 | GtkCellRenderer* browser_cell_renderer_variant_new(void); 46 | 47 | G_END_DECLS 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserDownloadsBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef BrowserDownloadsBar_h 27 | #define BrowserDownloadsBar_h 28 | 29 | #include 30 | #include 31 | 32 | #if !GTK_CHECK_VERSION(3, 98, 0) 33 | 34 | G_BEGIN_DECLS 35 | 36 | #define BROWSER_TYPE_DOWNLOADS_BAR (browser_downloads_bar_get_type()) 37 | #define BROWSER_DOWNLOADS_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_DOWNLOADS_BAR, BrowserDownloadsBar)) 38 | #define BROWSER_IS_DOWNLOADS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_DOWNLOADS_BAR)) 39 | #define BROWSER_DOWNLOADS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_DOWNLOADS_BAR, BrowserDownloadsBarClass)) 40 | #define BROWSER_IS_DOWNLOADS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_DOWNLOADS_BAR)) 41 | #define BROWSER_DOWNLOADS_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_DOWNLOADS_BAR, BrowserDownloadsBarClass)) 42 | 43 | typedef struct _BrowserDownloadsBar BrowserDownloadsBar; 44 | typedef struct _BrowserDownloadsBarClass BrowserDownloadsBarClass; 45 | 46 | GType browser_downloads_bar_get_type(void); 47 | 48 | GtkWidget *browser_downloads_bar_new(void); 49 | void browser_downloads_bar_add_download(BrowserDownloadsBar *, WebKitDownload *); 50 | 51 | G_END_DECLS 52 | 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserPane.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserPane.h -- The declaration of BrowserPane. 3 | ** 4 | ** Copyright (C) 2022 FMSoft 5 | ** 6 | ** Author: Vincent Wei 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANPANEILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef BrowserPane_h 24 | #define BrowserPane_h 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define BROWSER_TYPE_PANE (browser_pane_get_type()) 32 | #define BROWSER_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_PANE, BrowserPane)) 33 | #define BROWSER_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_PANE, BrowserPaneClass)) 34 | #define BROWSER_IS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_PANE)) 35 | #define BROWSER_IS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_PANE)) 36 | #define BROWSER_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_PANE, BrowserPaneClass)) 37 | 38 | typedef struct _BrowserPane BrowserPane; 39 | typedef struct _BrowserPaneClass BrowserPaneClass; 40 | 41 | /* 42 | * BrowserPane only contains one webView and an overlay widget for messages. 43 | * BrowserTab is derived from BrowserPane. 44 | */ 45 | struct _BrowserPane { 46 | GtkBox parent; 47 | 48 | WebKitWebView *webView; 49 | GtkWidget *overlay; 50 | GtkWidget *statusLabel; 51 | GtkWidget *searchBar; 52 | 53 | GtkWidget *fullScreenMessageLabel; 54 | guint fullScreenMessageLabelId; 55 | gboolean wasSearchingWhenEnteredFullscreen; 56 | 57 | GtkWidget *pointerLockMessageLabel; 58 | guint pointerLockMessageLabelId; 59 | 60 | gboolean inspectorIsVisible; 61 | }; 62 | 63 | struct _BrowserPaneClass { 64 | GtkBoxClass parent; 65 | }; 66 | 67 | GType browser_pane_get_type(void); 68 | 69 | GtkWidget* browser_pane_new(WebKitWebView*); 70 | WebKitWebView* browser_pane_get_web_view(BrowserPane*); 71 | void browser_pane_load_uri(BrowserPane*, const char* uri); 72 | void browser_pane_set_status_text(BrowserPane*, const char* text); 73 | void browser_pane_toggle_inspector(BrowserPane*); 74 | void browser_pane_set_background_color(BrowserPane*, GdkRGBA*); 75 | void browser_pane_start_search(BrowserPane*); 76 | void browser_pane_stop_search(BrowserPane*); 77 | void browser_pane_enter_fullscreen(BrowserPane*); 78 | void browser_pane_leave_fullscreen(BrowserPane*); 79 | 80 | G_END_DECLS 81 | 82 | #define BRW_PANE2VIEW(tab) browser_pane_get_web_view((tab)) 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserPlainWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserPlainWindow.h -- The declaration of BrowserPlainWindow. 3 | ** 4 | ** Copyright (C) 2022 FMSoft 5 | ** 6 | ** Author: Vincent Wei 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef BrowserPlainWindow_h 24 | #define BrowserPlainWindow_h 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define BROWSER_TYPE_PLAIN_WINDOW (browser_plain_window_get_type()) 32 | #define BROWSER_PLAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_PLAIN_WINDOW, BrowserPlainWindow)) 33 | #define BROWSER_PLAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_PLAIN_WINDOW, BrowserPlainWindowClass)) 34 | #define BROWSER_IS_PLAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_PLAIN_WINDOW)) 35 | #define BROWSER_IS_PLAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_PLAIN_WINDOW)) 36 | #define BROWSER_PLAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_PLAIN_WINDOW, BrowserPlainWindowClass)) 37 | 38 | typedef struct _BrowserPlainWindow BrowserPlainWindow; 39 | typedef struct _BrowserPlainWindowClass BrowserPlainWindowClass; 40 | 41 | GType browser_plain_window_get_type(void); 42 | 43 | GtkWidget* browser_plain_window_new(GtkWindow*, WebKitWebContext*, 44 | const char*, const char*); 45 | WebKitWebContext* browser_plain_window_get_web_context(BrowserPlainWindow*); 46 | void browser_plain_window_set_view(BrowserPlainWindow*, WebKitWebView*); 47 | WebKitWebView* browser_plain_window_get_view(BrowserPlainWindow*); 48 | const char* browser_plain_window_get_name(BrowserPlainWindow*); 49 | void browser_plain_window_set_title(BrowserPlainWindow*, const char*); 50 | 51 | void browser_plain_window_load_uri(BrowserPlainWindow*, const char *); 52 | void browser_plain_window_load_session(BrowserPlainWindow*, const char*); 53 | void browser_plain_window_set_background_color(BrowserPlainWindow*, GdkRGBA*); 54 | void browser_plain_window_move(BrowserPlainWindow*, int x, int y, int w, 55 | int h, bool sync_webview); 56 | 57 | G_END_DECLS 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserSearchBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2020 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef BrowserSearchBox_h 27 | #define BrowserSearchBox_h 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define BROWSER_TYPE_SEARCH_BOX (browser_search_box_get_type()) 35 | #define BROWSER_SEARCH_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_SEARCH_BOX, BrowserSearchBox)) 36 | #define BROWSER_IS_SEARCH_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_SEARCH_BOX)) 37 | #define BROWSER_SEARCH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_SEARCH_BOX, BrowserSearchBoxClass)) 38 | #define BROWSER_IS_SEARCH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_SEARCH_BOX)) 39 | #define BROWSER_SEARCH_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_SEARCH_BOX, BrowserSearchBoxClass)) 40 | 41 | typedef struct _BrowserSearchBox BrowserSearchBox; 42 | typedef struct _BrowserSearchBoxClass BrowserSearchBoxClass; 43 | 44 | struct _BrowserSearchBoxClass { 45 | GtkBoxClass parent_class; 46 | }; 47 | 48 | GType browser_search_box_get_type(void); 49 | 50 | GtkWidget *browser_search_box_new(WebKitWebView *); 51 | GtkEntry *browser_search_box_get_entry(BrowserSearchBox *); 52 | 53 | G_END_DECLS 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserSettingsDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef BrowserSettingsDialog_h 27 | #define BrowserSettingsDialog_h 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define BROWSER_TYPE_SETTINGS_DIALOG (browser_settings_dialog_get_type()) 35 | #define BROWSER_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_SETTINGS_DIALOG, BrowserSettingsDialog)) 36 | #define BROWSER_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_SETTINGS_DIALOG, BrowserSettingsDialogClass)) 37 | #define BROWSER_IS_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_SETTINGS_DIALOG)) 38 | #define BROWSER_IS_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_SETTINGS_DIALOG)) 39 | #define BROWSER_SETTINGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_SETTINGS_DIALOG, BrowserSettingsDialogClass)) 40 | 41 | typedef struct _BrowserSettingsDialog BrowserSettingsDialog; 42 | typedef struct _BrowserSettingsDialogClass BrowserSettingsDialogClass; 43 | 44 | GType browser_settings_dialog_get_type(void); 45 | 46 | GtkWidget* browser_settings_dialog_new(WebKitSettings *settings); 47 | 48 | G_END_DECLS 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /source/bin/gtk/BrowserWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef BrowserWindow_h 27 | #define BrowserWindow_h 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define BROWSER_TYPE_WINDOW (browser_window_get_type()) 35 | #define BROWSER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_WINDOW, BrowserWindow)) 36 | #define BROWSER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_WINDOW, BrowserWindowClass)) 37 | #define BROWSER_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_WINDOW)) 38 | #define BROWSER_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_WINDOW)) 39 | #define BROWSER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_WINDOW, BrowserWindowClass)) 40 | 41 | typedef struct _BrowserWindow BrowserWindow; 42 | typedef struct _BrowserWindowClass BrowserWindowClass; 43 | 44 | GType browser_window_get_type(void); 45 | 46 | GtkWidget* browser_window_new(GtkWindow*, WebKitWebContext*); 47 | WebKitWebContext* browser_window_get_web_context(BrowserWindow*); 48 | void browser_window_append_view(BrowserWindow*, WebKitWebView*); 49 | void browser_window_load_uri(BrowserWindow*, const char *uri); 50 | void browser_window_load_session(BrowserWindow *, const char *sessionFile); 51 | void browser_window_set_background_color(BrowserWindow*, GdkRGBA*); 52 | WebKitWebView* browser_window_get_or_create_web_view_for_automation(BrowserWindow*); 53 | WebKitWebView *browser_window_create_web_view_in_new_tab_for_automation(BrowserWindow*); 54 | 55 | GtkWidget *browser_window_webview_create(WebKitWebView*, WebKitNavigationAction*, BrowserWindow*); 56 | 57 | G_END_DECLS 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /source/bin/gtk/BuildRevision.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #define BUILD_REVISION "@WEBKIT2GTK_BUILD_REVISION@.HVML" 29 | #define WEBKITGTK_API_VERSION_STRING "@WEBKIT2GTK_API_VERSION@" 30 | -------------------------------------------------------------------------------- /source/bin/gtk/FloatingWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FloatingWindow.h -- The declaration of FloatingWindow. 3 | ** 4 | ** Copyright (C) 2023 FMSoft 5 | ** 6 | ** Author: XueShuming 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef FloatingWindow_h 24 | #define FloatingWindow_h 25 | 26 | #include 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif /* __cplusplus */ 32 | 33 | GtkWidget *create_floating_window(void); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif /* __cplusplus */ 38 | 39 | #endif /* FloatingWindow_h */ 40 | 41 | -------------------------------------------------------------------------------- /source/bin/gtk/LayouterWidgets.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LayouterWidgets.h -- The management of widgets for layouter. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef LayouterWidgets_h 24 | #define LayouterWidgets_h 25 | 26 | #include "purcmc/purcmc.h" 27 | #include "layouter/layouter.h" 28 | 29 | #include "utils/list.h" 30 | #include "utils/kvlist.h" 31 | #include "utils/sorted-array.h" 32 | #include 33 | 34 | /* handle types */ 35 | enum { 36 | HT_WORKSPACE = 0, 37 | HT_PLAINWIN, 38 | HT_TABBEDWIN, 39 | HT_CONTAINER, 40 | HT_PANE_TAB, 41 | HT_WEBVIEW, 42 | }; 43 | 44 | struct purcmc_workspace { 45 | /* page to owners map */ 46 | pcutils_kvlist_t page_owners; 47 | 48 | /* manager of grouped plain windows and pages */ 49 | struct ws_layouter *layouter; 50 | }; 51 | 52 | struct purcmc_session { 53 | purcmc_server *srv; 54 | 55 | WebKitSettings *webkit_settings; 56 | WebKitWebContext *web_context; 57 | 58 | /* the sorted array of all valid handles */ 59 | struct sorted_array *all_handles; 60 | 61 | /* the pending requests */ 62 | struct kvlist pending_responses; 63 | 64 | /* the only workspace for all sessions of current app */ 65 | purcmc_workspace *workspace; 66 | 67 | /* the URI prefix: hvml:///// */ 68 | char *uri_prefix; 69 | 70 | bool allow_switching_rdr; 71 | }; 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | void gtk_imp_get_monitor_geometry(struct ws_metrics *ws_geometry); 78 | 79 | void gtk_imp_convert_style(struct ws_widget_info *style, 80 | purc_variant_t toolkit_style); 81 | 82 | void gtk_imp_evaluate_geometry(struct ws_widget_info *style, 83 | const char *layout_style); 84 | 85 | void gtk_imp_evaluate_transition(struct ws_widget_info *style, 86 | const char *transition_style); 87 | 88 | void *gtk_imp_create_widget(void *workspace, void *session, 89 | ws_widget_type_t type, void *window, 90 | void *parent, void *init_arg, const struct ws_widget_info *style); 91 | 92 | int gtk_imp_destroy_widget(void *workspace, void *session, 93 | void *window, void *widget, ws_widget_type_t type); 94 | 95 | void gtk_imp_update_widget(void *workspace, void *session, void *widget, 96 | ws_widget_type_t type, const struct ws_widget_info *style); 97 | 98 | uint64_t gtk_imp_get_last_widget(void *session); 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | 104 | #endif /* LayouterWidgets_h */ 105 | 106 | -------------------------------------------------------------------------------- /source/bin/gtk/browser-marshal.list: -------------------------------------------------------------------------------- 1 | VOID:STRING,BOXED 2 | -------------------------------------------------------------------------------- /source/bin/gtk/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** main.h -- The common header. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef main_h 24 | #define main_h 25 | 26 | #include "xguipro-version.h" 27 | #include "xguipro-features.h" 28 | 29 | #include 30 | #include 31 | 32 | #define BROWSER_DEFAULT_TITLE "xGUI Pro" 33 | #define BROWSER_DEFAULT_URL "hvml://localhost/default" 34 | #define BROWSER_ABOUT_SCHEME "xguipro" 35 | #define BROWSER_HVML_SCHEME "hvml" 36 | 37 | typedef enum { 38 | XGUI_PRO_ERROR_INVALID_ABOUT_PATH, 39 | XGUI_PRO_ERROR_INVALID_HVML_URI 40 | } xGUIProError; 41 | 42 | static inline GQuark xguipro_error_quark() 43 | { 44 | return g_quark_from_string("xguipro-quark"); 45 | } 46 | 47 | #define XGUI_PRO_ERROR (xguipro_error_quark()) 48 | 49 | #ifdef NDEBUG 50 | #define LOG_DEBUG(x, ...) 51 | #else 52 | #define LOG_DEBUG(x, ...) \ 53 | purc_log_debug("%s: " x, __func__, ##__VA_ARGS__) 54 | #endif /* not defined NDEBUG */ 55 | 56 | #define LOG_ERROR(x, ...) \ 57 | purc_log_error("%s: " x, __func__, ##__VA_ARGS__) 58 | 59 | #define LOG_WARN(x, ...) \ 60 | purc_log_warn("%s: " x, __func__, ##__VA_ARGS__) 61 | 62 | #define LOG_INFO(x, ...) \ 63 | purc_log_info("%s: " x, __func__, ##__VA_ARGS__) 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* main_h */ 74 | 75 | -------------------------------------------------------------------------------- /source/bin/layout-panes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 |
30 |
31 |
    32 |
33 |
    34 |
35 |
36 |
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /source/bin/minigui/BrowserLayoutContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserLayoutContainer.h -- The declaration of BrowserLayoutContainer. 3 | ** 4 | ** Copyright (C) 2022, 2023 FMSoft 5 | ** 6 | ** This file is part of xGUI Pro, an advanced HVML renderer. 7 | ** 8 | ** xGUI Pro is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** xGUI Pro is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program. If not, see http://www.gnu.org/licenses/. 19 | */ 20 | 21 | #ifndef BrowserLayoutContainer_h 22 | #define BrowserLayoutContainer_h 23 | 24 | #include 25 | #include "Common.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define BROWSER_TYPE_LAYOUT_CONTAINER (browser_layout_container_get_type()) 30 | #define BROWSER_LAYOUT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_LAYOUT_CONTAINER, BrowserLayoutContainer)) 31 | #define BROWSER_LAYOUT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_LAYOUT_CONTAINER, BrowserLayoutContainerClass)) 32 | #define BROWSER_IS_LAYOUT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_LAYOUT_CONTAINER)) 33 | #define BROWSER_IS_LAYOUT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_LAYOUT_CONTAINER)) 34 | #define BROWSER_LAYOUT_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_LAYOUT_CONTAINER, BrowserLayoutContainerClass)) 35 | 36 | typedef struct _BrowserLayoutContainer BrowserLayoutContainer; 37 | typedef struct _BrowserLayoutContainerClass BrowserLayoutContainerClass; 38 | 39 | typedef struct _BrowserTabbedWindow BrowserTabbedWindow; 40 | 41 | GType browser_layout_container_get_type(void); 42 | 43 | BrowserLayoutContainer *browser_layout_container_new(BrowserTabbedWindow *window, 44 | GObject *container, const char *klass, const RECT *geometry); 45 | HWND browser_layout_container_get_hwnd(BrowserLayoutContainer*); 46 | 47 | 48 | G_END_DECLS 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /source/bin/minigui/BrowserPane.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserPane.h -- The declaration of BrowserPane. 3 | ** 4 | ** Copyright (C) 2022 FMSoft 5 | ** 6 | ** Author: Vincent Wei 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANPANEILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef BrowserPane_h 24 | #define BrowserPane_h 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "Common.h" 34 | 35 | G_BEGIN_DECLS 36 | 37 | #define BROWSER_TYPE_PANE (browser_pane_get_type()) 38 | #define BROWSER_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_PANE, BrowserPane)) 39 | #define BROWSER_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_PANE, BrowserPaneClass)) 40 | #define BROWSER_IS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_PANE)) 41 | #define BROWSER_IS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_PANE)) 42 | #define BROWSER_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_PANE, BrowserPaneClass)) 43 | 44 | typedef struct _BrowserPane BrowserPane; 45 | typedef struct _BrowserPaneClass BrowserPaneClass; 46 | 47 | /* 48 | * BrowserPane only contains one webView and an overlay widget for messages. 49 | * BrowserTab is derived from BrowserPane. 50 | */ 51 | struct _BrowserPane { 52 | GObject parent; 53 | 54 | WebKitWebViewParam param; 55 | WebKitWebView *webView; 56 | 57 | HWND hwnd; 58 | HWND parentHwnd; 59 | }; 60 | 61 | struct _BrowserPaneClass { 62 | GObjectClass parent; 63 | }; 64 | 65 | GType browser_pane_get_type(void); 66 | 67 | BrowserPane* browser_pane_new(WebKitWebViewParam*); 68 | WebKitWebView* browser_pane_get_web_view(BrowserPane*); 69 | void browser_pane_load_uri(BrowserPane*, const char* uri); 70 | void browser_pane_set_status_text(BrowserPane*, const char* text); 71 | void browser_pane_toggle_inspector(BrowserPane*); 72 | void browser_pane_set_background_color(BrowserPane*, GAL_Color* color); 73 | void browser_pane_start_search(BrowserPane*); 74 | void browser_pane_stop_search(BrowserPane*); 75 | void browser_pane_enter_fullscreen(BrowserPane*); 76 | void browser_pane_leave_fullscreen(BrowserPane*); 77 | 78 | G_END_DECLS 79 | 80 | #define BRW_PANE2VIEW(tab) browser_pane_get_web_view((tab)) 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /source/bin/minigui/BrowserPaneContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserPaneContainer.h -- The declaration of BrowserPaneContainer. 3 | ** 4 | ** Copyright (C) 2022, 2023 FMSoft 5 | ** 6 | ** This file is part of xGUI Pro, an advanced HVML renderer. 7 | ** 8 | ** xGUI Pro is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** xGUI Pro is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program. If not, see http://www.gnu.org/licenses/. 19 | */ 20 | 21 | #ifndef BrowserPaneContainer_h 22 | #define BrowserPaneContainer_h 23 | 24 | #include 25 | #include "BrowserPane.h" 26 | #include "Common.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define BROWSER_TYPE_PANE_CONTAINER (browser_pane_container_get_type()) 31 | #define BROWSER_PANE_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_PANE_CONTAINER, BrowserPaneContainer)) 32 | #define BROWSER_PANE_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_PANE_CONTAINER, BrowserPaneContainerClass)) 33 | #define BROWSER_IS_PANE_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_PANE_CONTAINER)) 34 | #define BROWSER_IS_PANE_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_PANE_CONTAINER)) 35 | #define BROWSER_PANE_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_PANE_CONTAINER, BrowserPaneContainerClass)) 36 | 37 | typedef struct _BrowserPaneContainer BrowserPaneContainer; 38 | typedef struct _BrowserPaneContainerClass BrowserPaneContainerClass; 39 | 40 | typedef struct _BrowserTabbedWindow BrowserTabbedWindow; 41 | 42 | GType browser_pane_container_get_type(void); 43 | 44 | BrowserPaneContainer *browser_pane_container_new(BrowserTabbedWindow *window, 45 | GObject *container, const char *klass, const RECT *geometry); 46 | HWND browser_pane_container_get_hwnd(BrowserPaneContainer*); 47 | 48 | void browser_pane_container_add_child(BrowserPaneContainer*, BrowserPane*); 49 | GSList *browser_pane_container_get_children(BrowserPaneContainer*); 50 | 51 | G_END_DECLS 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /source/bin/minigui/BrowserTabContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** BrowserTabContainer.h -- The declaration of BrowserTabContainer. 3 | ** 4 | ** Copyright (C) 2022, 2023 FMSoft 5 | ** 6 | ** This file is part of xGUI Pro, an advanced HVML renderer. 7 | ** 8 | ** xGUI Pro is free software: you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation, either version 3 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** xGUI Pro is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program. If not, see http://www.gnu.org/licenses/. 19 | */ 20 | 21 | #ifndef BrowserTabContainer_h 22 | #define BrowserTabContainer_h 23 | 24 | #include 25 | #include "Common.h" 26 | #include "BrowserTab.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define BROWSER_TYPE_TAB_CONTAINER (browser_tab_container_get_type()) 31 | #define BROWSER_TAB_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BROWSER_TYPE_TAB_CONTAINER, BrowserTabContainer)) 32 | #define BROWSER_TAB_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BROWSER_TYPE_TAB_CONTAINER, BrowserTabContainerClass)) 33 | #define BROWSER_IS_TAB_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BROWSER_TYPE_TAB_CONTAINER)) 34 | #define BROWSER_IS_TAB_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BROWSER_TYPE_TAB_CONTAINER)) 35 | #define BROWSER_TAB_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BROWSER_TYPE_TAB_CONTAINER, BrowserTabContainerClass)) 36 | 37 | typedef struct _BrowserTabContainer BrowserTabContainer; 38 | typedef struct _BrowserTabContainerClass BrowserTabContainerClass; 39 | 40 | typedef struct _BrowserTabbedWindow BrowserTabbedWindow; 41 | 42 | GType browser_tab_container_get_type(void); 43 | 44 | BrowserTabContainer *browser_tab_container_new(BrowserTabbedWindow *window, 45 | GObject *container, const RECT *geometry); 46 | HWND browser_tab_container_get_hwnd(BrowserTabContainer*); 47 | 48 | void browser_tab_container_add_child(BrowserTabContainer *container, 49 | BrowserTab *tab); 50 | GSList *browser_tab_container_get_children(BrowserTabContainer *container); 51 | 52 | G_END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /source/bin/minigui/BuildRevision.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Igalia S.L. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | * THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #pragma once 27 | 28 | #define BUILD_REVISION "@WEBKIT2HBD_BUILD_REVISION@.HVML" 29 | #define WEBKITHBD_API_VERSION_STRING "@WEBKIT2HBD_API_VERSION@" 30 | -------------------------------------------------------------------------------- /source/bin/minigui/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Common.h -- The declarations of common structure and api. 3 | ** 4 | ** Copyright (C) 2023 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** 7 | ** This file is part of xGUI Pro, an advanced HVML renderer. 8 | ** 9 | ** xGUI Pro is free software: you can redistribute it and/or modify 10 | ** it under the terms of the GNU General Public License as published by 11 | ** the Free Software Foundation, either version 3 of the License, or 12 | ** (at your option) any later version. 13 | ** 14 | ** xGUI Pro is distributed in the hope that it will be useful, 15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ** GNU General Public License for more details. 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with this program. If not, see http://www.gnu.org/licenses/. 20 | */ 21 | 22 | #ifndef Common_h 23 | #define Common_h 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define IDC_BROWSER 140 30 | #define IDC_PLAIN_WINDOW 141 31 | #define IDC_PROPSHEET 142 32 | #define IDC_URI_ENTRY 143 33 | #define IDC_CONTAINER 144 34 | 35 | #define IDC_ADDRESS_LEFT 5 36 | #define IDC_ADDRESS_TOP 3 37 | #define IDC_ADDRESS_HEIGHT 20 38 | 39 | #define KEY_XGUI_APPLICATION "xgui-application" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | extern GApplication *g_xgui_application; 46 | extern HWND g_xgui_main_window; 47 | extern HWND g_xgui_floating_window; 48 | extern PBITMAP g_xgui_window_bg; 49 | 50 | typedef struct { 51 | bool isControlledByAutomation; 52 | void *settings; 53 | void *userContentManager; 54 | void *webContext; 55 | void *websitePolicies; 56 | int webViewId; 57 | void *webViewParent; 58 | void *relatedView; 59 | RECT webViewRect; 60 | } WebKitWebViewParam; 61 | 62 | WebKitWebView *xgui_create_webview(WebKitWebViewParam *param); 63 | 64 | void xgui_window_inc(); 65 | void xgui_window_dec(); 66 | 67 | void xgui_destroy_event(pcrdr_msg *msg); 68 | 69 | double xgui_get_current_time(); 70 | 71 | void xgui_load_window_bg(); 72 | void xgui_unload_window_bg(); 73 | 74 | void xgui_webview_draw_background_callback(HWND hWnd, HDC hdc, RECT rect); 75 | 76 | enum EffMotionType xgui_get_motion_type(purc_window_transition_function func); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* Common_h */ 83 | 84 | -------------------------------------------------------------------------------- /source/bin/minigui/FloatingToolWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FloatingToolWindow.h -- The declaration of FloatingToolWindow. 3 | ** 4 | ** Copyright (C) 2023 FMSoft 5 | ** 6 | ** Author: Vincent Wei 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef FloatingToolWindow_h 24 | #define FloatingToolWindow_h 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #define MSG_XGUIPRO_LOAD_STATE (MSG_USER + 1) 32 | 33 | enum { 34 | XGUIPRO_LOAD_STATE_INITIAL = 0, 35 | XGUIPRO_LOAD_STATE_REDIRECTED, 36 | XGUIPRO_LOAD_STATE_COMMITTED, 37 | XGUIPRO_LOAD_STATE_TITLE_CHANGED, 38 | XGUIPRO_LOAD_STATE_PROGRESS_CHANGED, 39 | XGUIPRO_LOAD_STATE_FINISHED, 40 | XGUIPRO_LOAD_STATE_FAILED, 41 | }; 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif /* __cplusplus */ 46 | 47 | HWND create_floating_tool_window(HWND hostingWnd, const char *title); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif /* __cplusplus */ 52 | 53 | #endif /* FloatingToolWindow_h */ 54 | 55 | -------------------------------------------------------------------------------- /source/bin/minigui/FloatingWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FloatingWindow.h -- The declaration of FloatingWindow. 3 | ** 4 | ** Copyright (C) 2023 FMSoft 5 | ** 6 | ** Author: XueShuming 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef FloatingWindow_h 24 | #define FloatingWindow_h 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #define MSG_XGUIPRO_NEW_RDR (MSG_USER + 1) 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | 37 | HWND create_floating_window(HWND hostingWnd, const char *title); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif /* __cplusplus */ 42 | 43 | #endif /* FloatingWindow_h */ 44 | 45 | -------------------------------------------------------------------------------- /source/bin/minigui/LayouterWidgets.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LayouterWidgets.h -- The management of widgets for layouter. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef LayouterWidgets_h 24 | #define LayouterWidgets_h 25 | 26 | #include "purcmc/purcmc.h" 27 | #include "layouter/layouter.h" 28 | 29 | #include "utils/list.h" 30 | #include "utils/kvlist.h" 31 | #include "utils/sorted-array.h" 32 | 33 | /* handle types */ 34 | enum { 35 | HT_WORKSPACE = 0, 36 | HT_PLAINWIN, 37 | HT_TABBEDWIN, 38 | HT_CONTAINER, 39 | HT_PANE_TAB, 40 | HT_WEBVIEW, 41 | }; 42 | 43 | struct purcmc_workspace { 44 | /* page to owners map */ 45 | pcutils_kvlist_t page_owners; 46 | 47 | /* manager of grouped plain windows and pages */ 48 | struct ws_layouter *layouter; 49 | }; 50 | 51 | struct purcmc_session { 52 | purcmc_server *srv; 53 | 54 | WebKitSettings *webkit_settings; 55 | WebKitWebContext *web_context; 56 | 57 | /* the sorted array of all valid handles */ 58 | struct sorted_array *all_handles; 59 | 60 | /* the pending requests */ 61 | struct kvlist pending_responses; 62 | 63 | /* the only workspace for all sessions of current app */ 64 | purcmc_workspace *workspace; 65 | 66 | /* the URI prefix: hvml:///// */ 67 | char *uri_prefix; 68 | 69 | bool allow_switching_rdr; 70 | bool is_removing; 71 | }; 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | void mg_imp_get_monitor_geometry(struct ws_metrics *ws_geometry); 78 | 79 | void mg_imp_convert_style(struct ws_widget_info *style, 80 | purc_variant_t toolkit_style); 81 | 82 | void mg_imp_evaluate_geometry(struct ws_widget_info *style, 83 | const char *layout_style, bool allow_scaling_by_density); 84 | 85 | void mg_imp_evaluate_transition(struct ws_widget_info *style, 86 | const char *transition_style); 87 | 88 | void *mg_imp_create_widget(void *workspace, void *session, 89 | ws_widget_type_t type, void *window, 90 | void *parent, void *init_arg, const struct ws_widget_info *style); 91 | 92 | int mg_imp_destroy_widget(void *workspace, void *session, 93 | void *window, void *widget, ws_widget_type_t type); 94 | 95 | void mg_imp_update_widget(void *workspace, void *session, void *widget, 96 | ws_widget_type_t type, const struct ws_widget_info *style); 97 | 98 | uint64_t mg_imp_get_last_widget(void *session); 99 | 100 | bool mg_find_handle(void *session, uint64_t handle, void **data); 101 | 102 | 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif /* LayouterWidgets_h */ 109 | 110 | -------------------------------------------------------------------------------- /source/bin/minigui/SwitchRendererWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** SwitchRendererWindow.h -- The declaration of SwitchRendererWindow. 3 | ** 4 | ** Copyright (C) 2023 FMSoft 5 | ** 6 | ** Author: XueShuming 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef SwitchRendererWindow_h 24 | #define SwitchRendererWindow_h 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | 37 | struct sd_remote_service; 38 | int show_switch_renderer_window(HWND hWnd, struct sd_remote_service *rs); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif /* __cplusplus */ 43 | 44 | #endif /* SwitchRendererWindow_h */ 45 | 46 | -------------------------------------------------------------------------------- /source/bin/minigui/browser-marshal.list: -------------------------------------------------------------------------------- 1 | VOID:STRING,BOXED 2 | -------------------------------------------------------------------------------- /source/bin/minigui/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** main.h -- The common header. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef main_h 24 | #define main_h 25 | 26 | #include "xguipro-version.h" 27 | #include "xguipro-features.h" 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #define BROWSER_DEFAULT_TITLE "xGUI Pro" 34 | #define BROWSER_DEFAULT_URL "hvml://localhost/default" 35 | #define BROWSER_ABOUT_SCHEME "xguipro" 36 | #define BROWSER_HVML_SCHEME "hvml" 37 | 38 | typedef enum { 39 | XGUI_PRO_ERROR_INVALID_ABOUT_PATH, 40 | XGUI_PRO_ERROR_INVALID_HVML_URI 41 | } xGUIProError; 42 | 43 | static inline GQuark xguipro_error_quark() 44 | { 45 | return g_quark_from_string("xguipro-quark"); 46 | } 47 | 48 | #define XGUI_PRO_ERROR (xguipro_error_quark()) 49 | 50 | #ifdef NDEBUG 51 | #define LOG_DEBUG(x, ...) 52 | #else 53 | #define LOG_DEBUG(x, ...) \ 54 | purc_log_debug("%s: " x, __func__, ##__VA_ARGS__) 55 | #endif /* not defined NDEBUG */ 56 | 57 | #define LOG_ERROR(x, ...) \ 58 | purc_log_error("%s: " x, __func__, ##__VA_ARGS__) 59 | 60 | #define LOG_WARN(x, ...) \ 61 | purc_log_warn("%s: " x, __func__, ##__VA_ARGS__) 62 | 63 | #define LOG_INFO(x, ...) \ 64 | purc_log_info("%s: " x, __func__, ##__VA_ARGS__) 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | RECT xphbd_get_default_window_rect(void); 71 | gboolean xphbd_use_floating_tool_window(void); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* main_h */ 78 | 79 | -------------------------------------------------------------------------------- /source/bin/purcmc/endpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** endpoint.h -- The endpoint management. 3 | ** 4 | ** Copyright (C) 2021, 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef XGUIPRO_PURCMC_ENDPOINT_H 24 | #define XGUIPRO_PURCMC_ENDPOINT_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include "server.h" 34 | 35 | purcmc_endpoint* new_endpoint (purcmc_server* srv, int type, void* client); 36 | purcmc_endpoint* get_curr_endpoint (purcmc_server* srv); 37 | 38 | /* causes to delete endpoint */ 39 | enum { 40 | CDE_SOCKET = 0, 41 | CDE_INITIALIZING, 42 | CDE_EXITING, 43 | CDE_LOST_CONNECTION, 44 | CDE_NO_RESPONDING, 45 | }; 46 | 47 | int del_endpoint (purcmc_server* srv, purcmc_endpoint* endpoint, int cause); 48 | 49 | bool store_dangling_endpoint (purcmc_server* srv, purcmc_endpoint* endpoint); 50 | bool remove_dangling_endpoint (purcmc_server* srv, purcmc_endpoint* endpoint); 51 | bool make_endpoint_ready (purcmc_server* srv, 52 | const char* endpoint_name, purcmc_endpoint* endpoint); 53 | 54 | int accept_endpoint (purcmc_server* srv, purcmc_endpoint* endpoint); 55 | int remove_endpoint (purcmc_server* srv, purcmc_endpoint* endpoint); 56 | 57 | int check_no_responding_endpoints (purcmc_server *srv); 58 | int check_dangling_endpoints (purcmc_server *srv); 59 | int check_timeout_dangling_endpoints (purcmc_server *srv); 60 | 61 | int send_packet_to_endpoint (purcmc_server* srv, 62 | purcmc_endpoint* endpoint, const char* body, int len_body); 63 | int send_initial_response (purcmc_server* srv, purcmc_endpoint* endpoint); 64 | int on_got_message(purcmc_server* srv, purcmc_endpoint* endpoint, const pcrdr_msg *msg); 65 | 66 | static inline int 67 | assemble_endpoint_name (purcmc_endpoint *endpoint, char *buff) 68 | { 69 | if (endpoint->host_name && endpoint->app_name && endpoint->runner_name) { 70 | return purc_assemble_endpoint_name (endpoint->host_name, 71 | endpoint->app_name, endpoint->runner_name, buff); 72 | } 73 | 74 | return 0; 75 | } 76 | 77 | #endif /* !XGUIPRO_PURCMC_ENDPOINT_H */ 78 | 79 | -------------------------------------------------------------------------------- /source/bin/schema/HVMLURISchema.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** hvmlURISchema.h -- header for hvml URI schema. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef hvmlURISchema_h 24 | #define hvmlURISchema_h 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void initializeWebExtensionsCallback(WebKitWebContext *context, 33 | gpointer user_data); 34 | 35 | void hvmlURISchemeRequestCallback(WebKitURISchemeRequest *request, 36 | WebKitWebContext *webContext); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* hvmlURISchema_h */ 43 | 44 | -------------------------------------------------------------------------------- /source/bin/schema/HbdrunURISchema.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** HbdrunURISchema.h -- header for hbdrun URI schema. 3 | ** 4 | ** Copyright (C) 2023 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: XueShuming 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef hbdrunURISchema_h 24 | #define hbdrunURISchema_h 25 | 26 | #include 27 | 28 | #define BROWSER_HBDRUN_SCHEME "hbdrun" 29 | 30 | #define BROWSER_HBDRUN_ACTION_PARAM_TYPE "type" 31 | #define BROWSER_HBDRUN_ACTION_PARAM_RESULT "result" 32 | #define BROWSER_HBDRUN_ACTION_PARAM_ENDPOINTS "endpoints" 33 | #define BROWSER_HBDRUN_ACTION_PARAM_RDR "rdr" 34 | #define BROWSER_HBDRUN_ACTION_PARAM_HANDLE "handle" 35 | 36 | #define BROWSER_HBDRUN_ACTION_TYPE_CONFIRM "confirm" 37 | #define BROWSER_HBDRUN_ACTION_TYPE_SWITCH_RDR "switchRdr" 38 | #define BROWSER_HBDRUN_ACTION_TYPE_SWITCH_WINDOW "switchWindow" 39 | #define BROWSER_HBDRUN_ACTION_TYPE_DUP_CONFIRM "dupConfirm" 40 | #define BROWSER_HBDRUN_ACTION_TYPE_DUP_CHOOSE "dupChoose" 41 | 42 | 43 | #define CONFIRM_RESULT_ACCEPT "Accept" 44 | #define CONFIRM_RESULT_ACCEPT_ONCE "AcceptOnce" 45 | #define CONFIRM_RESULT_ACCEPT_ALWAYS "AcceptALWAYS" 46 | #define CONFIRM_RESULT_DECLINE "Decline" 47 | 48 | #define CONFIRM_PARAM_LABEL "label" 49 | #define CONFIRM_PARAM_DESC "desc" 50 | #define CONFIRM_PARAM_ICON "icon" 51 | #define CONFIRM_PARAM_TIMEOUT "timeout" 52 | 53 | #define CONFIRM_TYPE_DUP "dup" 54 | #define CONFIRM_TYPE_DUP_CLOSE "dupClose" 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | void hbdrunURISchemeRequestCallback(WebKitURISchemeRequest *request, 61 | WebKitWebContext *webContext); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* hbdrunURISchema_h */ 68 | 69 | -------------------------------------------------------------------------------- /source/bin/sd/sd.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** sd.h -- header for Service Discovery. 3 | ** 4 | ** Copyright (C) 2022 FMSoft (http://www.fmsoft.cn) 5 | ** 6 | ** Author: Vincent Wei (https://github.com/VincentWei) 7 | ** 8 | ** This file is part of xGUI Pro, an advanced HVML renderer. 9 | ** 10 | ** xGUI Pro is free software: you can redistribute it and/or modify 11 | ** it under the terms of the GNU General Public License as published by 12 | ** the Free Software Foundation, either version 3 of the License, or 13 | ** (at your option) any later version. 14 | ** 15 | ** xGUI Pro is distributed in the hope that it will be useful, 16 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ** GNU General Public License for more details. 19 | ** You should have received a copy of the GNU General Public License 20 | ** along with this program. If not, see http://www.gnu.org/licenses/. 21 | */ 22 | 23 | #ifndef Service_Discovery_h 24 | #define Service_Discovery_h 25 | 26 | #include 27 | #include "purcmc/purcmc.h" 28 | 29 | #define SD_IP_V4_LEN 16 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | struct sd_remote_service { 36 | uint32_t index; 37 | time_t ct; 38 | 39 | char *full_name; 40 | char *reg_type; 41 | 42 | char *host; 43 | uint16_t port; 44 | 45 | char *txt; 46 | size_t nr_txt; 47 | 48 | struct purcmc_server *server; 49 | purcmc_endpoint *endpoint; 50 | void *hostingWindow; 51 | }; 52 | 53 | const char *sd_get_local_hostname(void); 54 | int sd_get_host_addr(const char *hostname, char *ipv4, size_t ipv4_sz, 55 | char *ipv6, size_t ipv6_sz); 56 | int sd_get_local_ip(char *ipv4, size_t ipv4_sz, char *ipv6, size_t ipv6_sz); 57 | 58 | void sd_remote_service_destroy(struct sd_remote_service *srv); 59 | 60 | void post_new_rendereer_event(struct sd_remote_service *srv); 61 | 62 | void switch_new_renderer(struct purcmc_server *server, 63 | purcmc_endpoint *endpoint, const char *host, uint16_t port); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* Service_Discovery_h */ 70 | 71 | -------------------------------------------------------------------------------- /source/bin/test_layouter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 43 | 44 | 45 | 46 | 47 |
48 |
49 |
50 | 51 |
    52 | 53 | 54 |
55 |
    56 | 57 | 58 | 59 |
60 |
61 |
62 | 63 |
64 |
65 | 66 |
67 | 68 |
69 | 70 | 71 | 72 |
73 | 74 |
75 | 76 |
77 |
78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /source/bin/utils/hbdrun-uri.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hvml-uri - utilities for HVML URI. 3 | * 4 | * Copyright (C) 2022 FMSoft 5 | * 6 | * Author: Vincent Wei 7 | * 8 | * Permission to use, copy, modify, and/or distribute this software for any 9 | * purpose with or without fee is hereby granted, provided that the above 10 | * copyright notice and this permission notice appear in all copies. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | */ 20 | 21 | #ifndef __BIN_UTILS_HBDRUN_URI_H 22 | #define __BIN_UTILS_HBDRUN_URI_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | size_t hbdrun_uri_assemble(char *uri, const char *host, const char* app, 31 | const char* runner, const char *group, const char *page); 32 | 33 | char* hbdrun_uri_assemble_alloc(const char* host, const char* app, 34 | const char* runner, const char *group, const char *page); 35 | 36 | bool hbdrun_uri_split(const char *uri, 37 | char *host, char *app, char *runner, char *group, char *page); 38 | 39 | /* 40 | * Break down an HVML URI in the following pattern: 41 | * 42 | * hbdrun://///[/][?key1=value1&key2=value2] 43 | * 44 | */ 45 | bool hbdrun_uri_split_alloc(const char *uri, 46 | char **host, char **app, char **runner, char **group, char **page); 47 | 48 | bool hbdrun_uri_get_query_value(const char *uri, const char *key, 49 | char *value_buff); 50 | 51 | bool hbdrun_uri_get_query_value_alloc(const char *uri, const char *key, 52 | char **value_buff); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __BIN_UTILS_HBDRUN_URI_H */ 59 | -------------------------------------------------------------------------------- /source/bin/webext/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | XGUIPRO_INCLUDE_CONFIG_FILES_IF_EXISTS() 2 | 3 | configure_file(assets/hvml.js.in ${xGUIPro_DERIVED_SOURCES_DIR}/webext/hvml.js @ONLY) 4 | configure_file(assets/about.html.in ${xGUIPro_DERIVED_SOURCES_DIR}/webext/about.html @ONLY) 5 | 6 | set(XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR "${XGUIPRO_WEB_EXTENSIONS_OUTPUT_DIR}/assets") 7 | set(XGUIPRO_WEBEXT_ASSETS_INSTALL_DIR "${XGUIPRO_WEB_EXTENSIONS_INSTALL_DIR}/assets") 8 | 9 | set(assets_SOURCES 10 | "${xGUIPro_DERIVED_SOURCES_DIR}/webext/hvml.js" 11 | "${xGUIPro_DERIVED_SOURCES_DIR}/webext/about.html" 12 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml.png" 13 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-v.png" 14 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-light.png" 15 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-dark.png" 16 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-light-h240.png" 17 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-dark-h240.png" 18 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-v-black.png" 19 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-v-fill-white.png" 20 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-v-fill.svg" 21 | "${XGUIPRO_BIN_DIR}/webext/assets/hvml-v.svg" 22 | "${XGUIPRO_BIN_DIR}/webext/assets/workspace-layouter.css" 23 | "${XGUIPRO_BIN_DIR}/webext/assets/splash.jpg" 24 | "${XGUIPRO_BIN_DIR}/webext/assets/arrow-left.png" 25 | "${XGUIPRO_BIN_DIR}/webext/assets/arrow-right.png" 26 | "${XGUIPRO_BIN_DIR}/webext/assets/screen-cast.png" 27 | "${XGUIPRO_BIN_DIR}/webext/assets/toggle.png" 28 | "${XGUIPRO_BIN_DIR}/webext/assets/home.png" 29 | "${XGUIPRO_BIN_DIR}/webext/assets/favicon.ico" 30 | ) 31 | 32 | set(bootstrap_VERSION "5.3.1") 33 | set(bootstrap_icons_VERSION "1.10.5") 34 | 35 | set(assets_FILES 36 | "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}/hvml.js" 37 | "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}/about.html" 38 | ) 39 | 40 | add_custom_command( 41 | OUTPUT ${assets_FILES} 42 | DEPENDS ${assets_SOURCES} 43 | COMMAND ${CMAKE_COMMAND} -E make_directory ${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR} 44 | COMMAND ${CMAKE_COMMAND} -E copy ${assets_SOURCES} ${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR} 45 | COMMENT "Copy assets..." 46 | VERBATIM) 47 | 48 | add_custom_target(assets DEPENDS ${assets_FILES}) 49 | add_dependencies(WebExtensionHVML assets) 50 | 51 | file(ARCHIVE_EXTRACT 52 | INPUT "${XGUIPRO_BIN_DIR}/webext/assets/bootstrap-${bootstrap_VERSION}-dist.zip" 53 | DESTINATION "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}") 54 | 55 | file(ARCHIVE_EXTRACT 56 | INPUT "${XGUIPRO_BIN_DIR}/webext/assets/bootstrap-icons-${bootstrap_icons_VERSION}.zip" 57 | DESTINATION "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}") 58 | 59 | install(FILES ${assets_SOURCES} 60 | DESTINATION ${XGUIPRO_WEBEXT_ASSETS_INSTALL_DIR}) 61 | 62 | install(DIRECTORY "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}/bootstrap-${bootstrap_VERSION}-dist" 63 | DESTINATION ${XGUIPRO_WEBEXT_ASSETS_INSTALL_DIR}) 64 | 65 | install(DIRECTORY "${XGUIPRO_WEBEXT_ASSETS_OUTPUT_DIR}/bootstrap-icons-${bootstrap_icons_VERSION}" 66 | DESTINATION ${XGUIPRO_WEBEXT_ASSETS_INSTALL_DIR}) 67 | 68 | -------------------------------------------------------------------------------- /source/bin/webext/PlatformGTK.cmake: -------------------------------------------------------------------------------- 1 | set(WebKitWebExtension_INCLUDE_DIRECTORIES 2 | "${CMAKE_BINARY_DIR}" 3 | "${xGUIPro_DERIVED_SOURCES_DIR}" 4 | "${XGUIPRO_LIB_DIR}" 5 | "${XGUIPRO_BIN_DIR}" 6 | ) 7 | 8 | set(WebKitWebExtension_SYSTEM_INCLUDE_DIRECTORIES 9 | ${GLIB_INCLUDE_DIRS} 10 | ${GTK_INCLUDE_DIRS} 11 | ${LIBSOUP_INCLUDE_DIRS} 12 | ${WebKit_INCLUDE_DIRS} 13 | ) 14 | 15 | set(WebKitWebExtension_DEFINITIONS 16 | ) 17 | 18 | set(WebKitWebExtension_LIBRARIES 19 | xGUIPro::xGUIPro 20 | ${GLIB_GOBJECT_LIBRARIES} 21 | ${GLIB_LIBRARIES} 22 | WebKit::JSC 23 | WebKit::WebKit 24 | ) 25 | 26 | set(WebExtensionHVML_SOURCES 27 | log.c 28 | glib/WebExtensionHVML.c 29 | ) 30 | 31 | macro(ADD_WK2_WEB_EXTENSION extension_name) 32 | add_library(${extension_name} SHARED ${ARGN}) 33 | add_dependencies(${extension_name} xguipro) 34 | set_property( 35 | TARGET ${extension_name} 36 | APPEND 37 | PROPERTY COMPILE_DEFINITIONS WEBEXT_COMPILATION 38 | ) 39 | set_target_properties(${extension_name} PROPERTIES 40 | LIBRARY_OUTPUT_DIRECTORY "${XGUIPRO_WEB_EXTENSIONS_OUTPUT_DIR}" 41 | ) 42 | target_compile_definitions(${extension_name} PUBLIC ${WebKitWebExtension_DEFINITIONS}) 43 | target_include_directories(${extension_name} PUBLIC ${WebKitWebExtension_INCLUDE_DIRECTORIES}) 44 | target_include_directories(${extension_name} SYSTEM PUBLIC ${WebKitWebExtension_SYSTEM_INCLUDE_DIRECTORIES}) 45 | target_link_libraries(${extension_name} ${WebKitWebExtension_LIBRARIES}) 46 | endmacro() 47 | 48 | ADD_WK2_WEB_EXTENSION(WebExtensionHVML ${WebExtensionHVML_SOURCES}) 49 | 50 | install(TARGETS WebExtensionHVML DESTINATION "${XGUIPRO_WEB_EXTENSIONS_INSTALL_DIR}") 51 | -------------------------------------------------------------------------------- /source/bin/webext/PlatformMiniGUI.cmake: -------------------------------------------------------------------------------- 1 | set(WebKitWebExtension_INCLUDE_DIRECTORIES 2 | "${CMAKE_BINARY_DIR}" 3 | "${xGUIPro_DERIVED_SOURCES_DIR}" 4 | "${XGUIPRO_LIB_DIR}" 5 | "${XGUIPRO_BIN_DIR}" 6 | ) 7 | 8 | set(WebKitWebExtension_SYSTEM_INCLUDE_DIRECTORIES 9 | ${GLIB_INCLUDE_DIRS} 10 | ${LIBSOUP_INCLUDE_DIRS} 11 | ${WebKit_INCLUDE_DIRS} 12 | ) 13 | 14 | set(WebKitWebExtension_DEFINITIONS 15 | ) 16 | 17 | set(WebKitWebExtension_LIBRARIES 18 | xGUIPro::xGUIPro 19 | ${GLIB_GOBJECT_LIBRARIES} 20 | ${GLIB_LIBRARIES} 21 | WebKit::JSC 22 | WebKit::WebKit 23 | ) 24 | 25 | set(WebExtensionHVML_SOURCES 26 | log.c 27 | glib/WebExtensionHVML.c 28 | ) 29 | 30 | macro(ADD_WK2_WEB_EXTENSION extension_name) 31 | add_library(${extension_name} SHARED ${ARGN}) 32 | add_dependencies(${extension_name} xguipro) 33 | set_property( 34 | TARGET ${extension_name} 35 | APPEND 36 | PROPERTY COMPILE_DEFINITIONS WEBEXT_COMPILATION 37 | ) 38 | set_target_properties(${extension_name} PROPERTIES 39 | LIBRARY_OUTPUT_DIRECTORY "${XGUIPRO_WEB_EXTENSIONS_OUTPUT_DIR}" 40 | ) 41 | target_compile_definitions(${extension_name} PUBLIC ${WebKitWebExtension_DEFINITIONS}) 42 | target_include_directories(${extension_name} PUBLIC ${WebKitWebExtension_INCLUDE_DIRECTORIES}) 43 | target_include_directories(${extension_name} SYSTEM PUBLIC ${WebKitWebExtension_SYSTEM_INCLUDE_DIRECTORIES}) 44 | target_link_libraries(${extension_name} ${WebKitWebExtension_LIBRARIES}) 45 | endmacro() 46 | 47 | ADD_WK2_WEB_EXTENSION(WebExtensionHVML ${WebExtensionHVML_SOURCES}) 48 | 49 | install(TARGETS WebExtensionHVML DESTINATION "${XGUIPRO_WEB_EXTENSIONS_INSTALL_DIR}") 50 | -------------------------------------------------------------------------------- /source/bin/webext/assets/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/arrow-left.png -------------------------------------------------------------------------------- /source/bin/webext/assets/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/arrow-right.png -------------------------------------------------------------------------------- /source/bin/webext/assets/bootstrap-5.1.3-dist.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/bootstrap-5.1.3-dist.zip -------------------------------------------------------------------------------- /source/bin/webext/assets/bootstrap-5.3.1-dist.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/bootstrap-5.3.1-dist.zip -------------------------------------------------------------------------------- /source/bin/webext/assets/bootstrap-icons-1.10.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/bootstrap-icons-1.10.5.zip -------------------------------------------------------------------------------- /source/bin/webext/assets/bootstrap-icons-1.8.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/bootstrap-icons-1.8.3.zip -------------------------------------------------------------------------------- /source/bin/webext/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/favicon.ico -------------------------------------------------------------------------------- /source/bin/webext/assets/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/home.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-dark-h240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-dark-h240.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-dark.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-light-h240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-light-h240.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-light.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-v-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-v-black.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-v-fill-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-v-fill-white.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-v-fill.svg: -------------------------------------------------------------------------------- 1 | V标-logo -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml-v.png -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml-v.svg: -------------------------------------------------------------------------------- 1 | V标-logo -------------------------------------------------------------------------------- /source/bin/webext/assets/hvml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/hvml.png -------------------------------------------------------------------------------- /source/bin/webext/assets/screen-cast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/screen-cast.png -------------------------------------------------------------------------------- /source/bin/webext/assets/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/splash.jpg -------------------------------------------------------------------------------- /source/bin/webext/assets/toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/bin/webext/assets/toggle.png -------------------------------------------------------------------------------- /source/bin/webext/assets/workspace-layouter.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding:0; 4 | width:auto; 5 | height:auto; 6 | } 7 | 8 | html { 9 | display: block; 10 | } 11 | 12 | head, link, meta, script, style, title { 13 | display: none; 14 | } 15 | 16 | body { 17 | display: block; 18 | height: 100%; 19 | } 20 | 21 | section { 22 | display:block; 23 | position:fixed; 24 | left:0; 25 | top:0; 26 | width:100%; 27 | height:100%; 28 | } 29 | 30 | article, figure, div, header, nav, aside, footer, menu { 31 | display:block; 32 | position:relative; 33 | } 34 | 35 | ol, ul { 36 | display:block; 37 | position:relative; 38 | list-style-type:none; 39 | margin-inline-start:0; 40 | margin-block-start: 0; 41 | margin-block-end: 0; 42 | margin-inline-start: 0; 43 | margin-inline-end: 0; 44 | padding-inline-start: 0; 45 | } 46 | 47 | ol > li { 48 | display:block; 49 | position:relative; 50 | } 51 | 52 | ul > li { 53 | display:block; 54 | position:absolute; 55 | left:0; 56 | top:0; 57 | width:100%; 58 | height:100%; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /source/bin/webext/log.c: -------------------------------------------------------------------------------- 1 | /* 2 | * log.c - The implementation of log facility. 3 | * 4 | * Copyright (C) 2022 FMSoft 5 | * 6 | * Authors: 7 | * Vincent Wei (https://github.com/VincentWei), 2022 8 | * 9 | * This file is a part of xGUI Pro, an advanced HVML renderer. 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU Lesser General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #include "config.h" 26 | #include "log.h" 27 | 28 | #include 29 | #include 30 | 31 | #if HAVE(SYSLOG_H) 32 | #include 33 | #else 34 | 35 | enum { 36 | LOG_EMERG, // system is unusable 37 | LOG_ALERT, // action must be taken immediately 38 | LOG_CRIT, // critical conditions 39 | LOG_ERR, // error conditions 40 | LOG_WARNING, // warning conditions 41 | LOG_NOTICE, // normal, but significant, condition 42 | LOG_INFO, // informational message 43 | LOG_DEBUG, // debug-level message 44 | }; 45 | 46 | static inline void openlog(const char *ident, int option, int facility) 47 | { 48 | (void)ident; 49 | (void)option; 50 | (void)facility; 51 | // do nothing; 52 | } 53 | 54 | static inline void vsyslog(int priority, const char *format, va_list ap) 55 | { 56 | (void)priority; 57 | vfprintf(stderr, format, ap); 58 | } 59 | #endif 60 | 61 | static FILE *fp_log; 62 | 63 | #define LOG_FILE_SYSLOG (FILE *)-1 64 | 65 | bool my_log_enable(bool enable, const char* syslog_ident) 66 | { 67 | if (enable) { 68 | if (syslog_ident) { 69 | openlog(syslog_ident, LOG_PID, LOG_USER); 70 | fp_log = LOG_FILE_SYSLOG; 71 | } 72 | else { 73 | fp_log = stderr; 74 | } 75 | } 76 | else { 77 | fp_log = NULL; 78 | } 79 | 80 | return true; 81 | } 82 | 83 | void my_log_with_tag(const char *tag, const char *msg, va_list ap) 84 | { 85 | if (fp_log == LOG_FILE_SYSLOG) { 86 | int priority = LOG_DEBUG; 87 | if (strcasecmp(tag, "INFO") == 0) 88 | priority = LOG_INFO; 89 | else if (strcasecmp(tag, "WARN") == 0) 90 | priority = LOG_WARNING; 91 | else if (strcasecmp(tag, "ERROR") == 0) 92 | priority = LOG_ERR; 93 | 94 | vsyslog(priority, msg, ap); 95 | } 96 | else if (fp_log == stderr) { 97 | fprintf(fp_log, "%s >> ", tag); 98 | vfprintf(fp_log, msg, ap); 99 | } 100 | } 101 | 102 | -------------------------------------------------------------------------------- /source/bin/webext/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @file log.h 3 | * @author Vincent Wei 4 | * @date 2022/05/19 5 | * @brief The internal interfaces for log. 6 | * 7 | * Copyright (C) 2022 FMSoft 8 | * 9 | * This file is a part of xGUI Pro, an advanced HVML renderer. 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU Lesser General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if __has_attribute(format) 31 | #define MY_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((format(printf, formatStringArgument, extraArguments))) 32 | #else 33 | #define MY_ATTRIBUTE_PRINTF 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | bool my_log_enable(bool enable, const char* syslog_ident); 41 | void my_log_with_tag(const char* tag, const char *msg, va_list ap) 42 | MY_ATTRIBUTE_PRINTF(2, 0); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | MY_ATTRIBUTE_PRINTF(1, 2) 49 | static inline void 50 | my_log_info(const char *msg, ...) 51 | { 52 | va_list ap; 53 | va_start(ap, msg); 54 | my_log_with_tag("INFO", msg, ap); 55 | va_end(ap); 56 | } 57 | 58 | MY_ATTRIBUTE_PRINTF(1, 2) 59 | static inline void 60 | my_log_debug(const char *msg, ...) 61 | { 62 | va_list ap; 63 | va_start(ap, msg); 64 | my_log_with_tag("DEBUG", msg, ap); 65 | va_end(ap); 66 | } 67 | 68 | MY_ATTRIBUTE_PRINTF(1, 2) 69 | static inline void 70 | my_log_warn(const char *msg, ...) 71 | { 72 | va_list ap; 73 | va_start(ap, msg); 74 | my_log_with_tag("WARN", msg, ap); 75 | va_end(ap); 76 | } 77 | 78 | MY_ATTRIBUTE_PRINTF(1, 2) 79 | static inline void 80 | my_log_error(const char *msg, ...) 81 | { 82 | va_list ap; 83 | va_start(ap, msg); 84 | my_log_with_tag("ERROR", msg, ap); 85 | va_end(ap); 86 | } 87 | 88 | MY_ATTRIBUTE_PRINTF(1, 2) 89 | static inline void 90 | my_log_jsc(const char *msg, ...) 91 | { 92 | va_list ap; 93 | va_start(ap, msg); 94 | my_log_with_tag("JSC", msg, ap); 95 | va_end(ap); 96 | } 97 | 98 | #ifdef NDEBUG 99 | #define LOG_DEBUG(x, ...) 100 | #else 101 | #define LOG_DEBUG(x, ...) \ 102 | my_log_debug("%s: " x, __func__, ##__VA_ARGS__) 103 | #endif /* not defined NDEBUG */ 104 | 105 | #define LOG_ERROR(x, ...) \ 106 | my_log_error("%s: " x, __func__, ##__VA_ARGS__) 107 | 108 | #define LOG_WARN(x, ...) \ 109 | my_log_warn("%s: " x, __func__, ##__VA_ARGS__) 110 | 111 | #define LOG_INFO(x, ...) \ 112 | my_log_info("%s: " x, __func__, ##__VA_ARGS__) 113 | 114 | #define LOG_JSC(x, ...) \ 115 | my_log_jsc("%s: " x, __func__, ##__VA_ARGS__) 116 | 117 | -------------------------------------------------------------------------------- /source/bin/xguipro-features.h.in: -------------------------------------------------------------------------------- 1 | /* This is an autogenerated file. Don't edit! */ 2 | 3 | #ifndef SIZEOF_UINTMAX_T 4 | #define SIZEOF_UINTMAX_T @SIZEOF_UINTMAX_T@ 5 | #endif 6 | 7 | #define SYSCONFDIR "@SYSCONFDIR@" 8 | #define DATADIR "@DATADIR@" 9 | #define EXTHELPERSDIR "@EXTHELPERSDIR@" 10 | #define SAVERDIR "@LIBEXECDIR@" 11 | 12 | #define WEBKIT_WEBEXT_DIR "@LIB_INSTALL_DIR@/xguipro" 13 | -------------------------------------------------------------------------------- /source/bin/xguipro-version.h.in: -------------------------------------------------------------------------------- 1 | /* This is an autogenerated file. Don't edit! */ 2 | 3 | #undef XGUIPRO_VERSION_STRING 4 | #define XGUIPRO_VERSION_STRING "@PROJECT_VERSION@" 5 | 6 | #undef HVMLJS_VERSION_CODE 7 | #define HVMLJS_VERSION_CODE @HVMLJS_VERSION@ 8 | 9 | #undef HVMLJS_VENDOR_STRING 10 | #define HVMLJS_VENDOR_STRING "@PACKAGE_VENDOR@" 11 | -------------------------------------------------------------------------------- /source/cmake/BubblewrapSandboxChecks.cmake: -------------------------------------------------------------------------------- 1 | if (ENABLE_BUBBLEWRAP_SANDBOX) 2 | find_program(BWRAP_EXECUTABLE bwrap) 3 | if (NOT BWRAP_EXECUTABLE) 4 | message(FATAL_ERROR "bwrap executable is needed for ENABLE_BUBBLEWRAP_SANDBOX") 5 | endif () 6 | 7 | find_package(Libseccomp) 8 | if (NOT LIBSECCOMP_FOUND) 9 | message(FATAL_ERROR "libseccomp is needed for ENABLE_BUBBLEWRAP_SANDBOX") 10 | endif () 11 | 12 | find_program(DBUS_PROXY_EXECUTABLE xdg-dbus-proxy) 13 | if (NOT DBUS_PROXY_EXECUTABLE) 14 | message(FATAL_ERROR "xdg-dbus-proxy not found and is needed for ENABLE_BUBBLEWRAP_SANDBOX") 15 | endif () 16 | 17 | if (NOT CMAKE_CROSSCOMPILING) 18 | execute_process( 19 | COMMAND "${BWRAP_EXECUTABLE}" --version 20 | RESULT_VARIABLE BWRAP_RET 21 | OUTPUT_VARIABLE BWRAP_OUTPUT 22 | ) 23 | if (BWRAP_RET) 24 | message(FATAL_ERROR "Failed to run ${BWRAP_EXECUTABLE}") 25 | endif () 26 | string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" BWRAP_VERSION "${BWRAP_OUTPUT}") 27 | if (NOT "${BWRAP_VERSION}" VERSION_GREATER_EQUAL "0.3.1") 28 | message(FATAL_ERROR "bwrap must be >= 0.3.1 but ${BWRAP_VERSION} found") 29 | endif () 30 | elseif (NOT SILENCE_CROSS_COMPILATION_NOTICES) 31 | message(NOTICE 32 | "***--------------------------------------------------------***\n" 33 | "*** Cannot check Bubblewrap version when cross-compiling. ***\n" 34 | "*** The target system MUST have version 0.3.1 or newer. ***\n" 35 | "*** Use the BWRAP_EXECUTABLE and DBUS_PROXY_EXECUTABLE ***\n" 36 | "*** variables to set the run-time paths for the 'bwrap' ***\n" 37 | "*** and 'xdg-dbus-proxy' programs. ***\n" 38 | "***--------------------------------------------------------***" 39 | ) 40 | endif () 41 | 42 | add_definitions(-DBWRAP_EXECUTABLE="${BWRAP_EXECUTABLE}") 43 | add_definitions(-DDBUS_PROXY_EXECUTABLE="${DBUS_PROXY_EXECUTABLE}") 44 | endif () 45 | -------------------------------------------------------------------------------- /source/cmake/DetectSSE2.cmake: -------------------------------------------------------------------------------- 1 | ################################# 2 | # Check for the presence of SSE2. 3 | # 4 | # Once done, this will define: 5 | # - SSE2_SUPPORT_FOUND - the system supports (at least) SSE2. 6 | # 7 | # Copyright (c) 2014, Pablo Fernandez Alcantarilla, Jesus Nuevo 8 | # Copyright (c) 2019, Igalia S.L. 9 | # 10 | # Redistribution and use in source and binary forms, with or without modification, 11 | # are permitted provided that the following conditions are met: 12 | # 13 | # * Redistributions of source code must retain the above copyright notice, 14 | # this list of conditions and the following disclaimer. 15 | # 16 | # * Redistributions in binary form must reproduce the above copyright notice, 17 | # this list of conditions and the following disclaimer in the documentation 18 | # and/or other materials provided with the distribution. 19 | # 20 | # * Neither the name of the copyright holders nor the names of its contributors 21 | # may be used to endorse or promote products derived from this software without 22 | # specific prior written permission. 23 | # 24 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 25 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 26 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 27 | # SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 30 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 32 | # WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | set(SSE2_SUPPORT_FOUND FALSE) 35 | 36 | macro(CHECK_FOR_SSE2) 37 | include(CheckCXXSourceRuns) 38 | 39 | check_cxx_source_runs(" 40 | #include 41 | int main () 42 | { 43 | __m128d a, b; 44 | double vals[2] = {0}; 45 | a = _mm_loadu_pd (vals); 46 | b = _mm_add_pd (a,a); 47 | _mm_storeu_pd (vals,b); 48 | return 0; 49 | }" 50 | HAVE_SSE2_EXTENSIONS) 51 | 52 | if (COMPILER_IS_GCC_OR_CLANG OR (MSVC AND NOT CMAKE_CL_64)) 53 | if (HAVE_SSE2_EXTENSIONS) 54 | set(SSE2_SUPPORT_FOUND TRUE) 55 | message(STATUS "Found SSE2 extensions") 56 | endif () 57 | endif () 58 | 59 | endmacro(CHECK_FOR_SSE2) 60 | 61 | CHECK_FOR_SSE2() 62 | -------------------------------------------------------------------------------- /source/cmake/FindDOMRuler.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 Beijing FMSoft Technologies Co., Ltd. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # 1. Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # 2. Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # 12 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 13 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 14 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 16 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 19 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 20 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 21 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 22 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | #[=======================================================================[.rst: 25 | FindDOMRuler 26 | -------------- 27 | 28 | Find DOMRuler headers and libraries. 29 | 30 | Imported Targets 31 | ^^^^^^^^^^^^^^^^ 32 | 33 | ``DOMRuler::DOMRuler`` 34 | The DOMRuler library, if found. 35 | 36 | Result Variables 37 | ^^^^^^^^^^^^^^^^ 38 | 39 | This will define the following variables in your project: 40 | 41 | ``DOMRULER_FOUND`` 42 | true if (the requested version of) DOMRuler is available. 43 | ``DOMRULER_VERSION`` 44 | the version of DOMRuler. 45 | ``DOMRULER_LIBRARIES`` 46 | the libraries to link against to use DOMRuler. 47 | ``DOMRULER_INCLUDE_DIRS`` 48 | where to find the DOMRuler headers. 49 | ``DOMRULER_COMPILE_OPTIONS`` 50 | this should be passed to target_compile_options(), if the 51 | target is not used for linking 52 | 53 | #]=======================================================================] 54 | 55 | # TODO: Remove when cmake_minimum_version bumped to 3.14. 56 | 57 | find_package(PkgConfig QUIET) 58 | pkg_check_modules(PC_DOMRULER QUIET domruler) 59 | set(DOMRULER_COMPILE_OPTIONS ${PC_DOMRULER_CFLAGS_OTHER}) 60 | set(DOMRULER_VERSION ${PC_DOMRULER_VERSION}) 61 | 62 | find_path(DOMRULER_INCLUDE_DIR 63 | NAMES domruler/domruler.h 64 | HINTS ${PC_DOMRULER_INCLUDEDIR} ${PC_DOMRULER_INCLUDE_DIR} 65 | ) 66 | 67 | find_library(DOMRULER_LIBRARY 68 | NAMES ${DOMRULER_NAMES} domruler 69 | HINTS ${PC_DOMRULER_LIBDIR} ${PC_DOMRULER_LIBRARY_DIRS} 70 | ) 71 | 72 | include(FindPackageHandleStandardArgs) 73 | find_package_handle_standard_args(DOMRuler 74 | FOUND_VAR DOMRULER_FOUND 75 | REQUIRED_VARS DOMRULER_LIBRARY DOMRULER_INCLUDE_DIR 76 | VERSION_VAR DOMRULER_VERSION 77 | ) 78 | 79 | if (DOMRULER_LIBRARY AND NOT TARGET DOMRuler::DOMRuler) 80 | add_library(DOMRuler::DOMRuler UNKNOWN IMPORTED GLOBAL) 81 | set_target_properties(DOMRuler::DOMRuler PROPERTIES 82 | IMPORTED_LOCATION "${DOMRULER_LIBRARY}" 83 | INTERFACE_COMPILE_OPTIONS "${DOMRULER_COMPILE_OPTIONS}" 84 | INTERFACE_INCLUDE_DIRECTORIES "${DOMRULER_INCLUDE_DIR}" 85 | ) 86 | endif () 87 | 88 | mark_as_advanced(DOMRULER_INCLUDE_DIR DOMRULER_LIBRARIES) 89 | 90 | if (DOMRULER_FOUND) 91 | set(DOMRULER_LIBRARIES ${DOMRULER_LIBRARY}) 92 | set(DOMRULER_INCLUDE_DIRS ${DOMRULER_INCLUDE_DIR}) 93 | endif () 94 | 95 | -------------------------------------------------------------------------------- /source/cmake/FindGObjectIntrospection.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find gobject-introspection 2 | # Once done, this will define 3 | # 4 | # INTROSPECTION_FOUND - system has gobject-introspection 5 | # INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner 6 | # INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler 7 | # INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate 8 | # INTROSPECTION_GIRDIR 9 | # INTROSPECTION_TYPELIBDIR 10 | # INTROSPECTION_CFLAGS 11 | # INTROSPECTION_LIBS 12 | # 13 | # Copyright (C) 2010, Pino Toscano, 14 | # Copyright (C) 2014 Igalia S.L. 15 | # 16 | # Redistribution and use is allowed according to the terms of the BSD license. 17 | 18 | macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname _extra_args) 19 | execute_process( 20 | COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} ${_extra_args} gobject-introspection-1.0 21 | OUTPUT_VARIABLE _result 22 | RESULT_VARIABLE _null 23 | ) 24 | 25 | if (_null) 26 | else () 27 | string(REGEX REPLACE "[\r\n]" " " _result "${_result}") 28 | string(REGEX REPLACE " +$" "" _result "${_result}") 29 | separate_arguments(_result) 30 | set(${_outvar} ${_result} CACHE INTERNAL "") 31 | endif () 32 | endmacro(_GIR_GET_PKGCONFIG_VAR) 33 | 34 | find_package(PkgConfig QUIET) 35 | if (PKG_CONFIG_FOUND) 36 | if (PACKAGE_FIND_VERSION_COUNT GREATER 0) 37 | set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") 38 | endif () 39 | pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) 40 | if (_pc_gir_FOUND) 41 | set(INTROSPECTION_FOUND TRUE) 42 | _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner" "") 43 | _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler" "") 44 | _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate" "") 45 | _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir" "") 46 | _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir" "") 47 | set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") 48 | set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") 49 | endif () 50 | endif () 51 | 52 | mark_as_advanced( 53 | INTROSPECTION_SCANNER 54 | INTROSPECTION_COMPILER 55 | INTROSPECTION_GENERATE 56 | INTROSPECTION_GIRDIR 57 | INTROSPECTION_TYPELIBDIR 58 | INTROSPECTION_CFLAGS 59 | INTROSPECTION_LIBS 60 | ) 61 | -------------------------------------------------------------------------------- /source/cmake/FindGperf.cmake: -------------------------------------------------------------------------------- 1 | # - Find gperf 2 | # This module looks for gperf. This module defines the 3 | # following values: 4 | # GPERF_EXECUTABLE: the full path to the gperf tool. 5 | # GPERF_FOUND: True if gperf has been found. 6 | 7 | include(FindCygwin) 8 | 9 | find_program(GPERF_EXECUTABLE 10 | gperf 11 | ${CYGWIN_INSTALL_PATH}/bin 12 | ) 13 | 14 | # handle the QUIETLY and REQUIRED arguments and set GPERF_FOUND to TRUE if 15 | # all listed variables are TRUE 16 | include(FindPackageHandleStandardArgs) 17 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gperf DEFAULT_MSG GPERF_EXECUTABLE) 18 | 19 | mark_as_advanced(GPERF_EXECUTABLE) 20 | -------------------------------------------------------------------------------- /source/cmake/FindLibGcrypt.cmake: -------------------------------------------------------------------------------- 1 | #.rst 2 | # FindLibGcrypt 3 | # ------------- 4 | # 5 | # Finds the Libgcrypt library. 6 | # 7 | # This will define the following variables: 8 | # 9 | # ``LIBGCRYPT_FOUND`` 10 | # True if the requested version of gcrypt was found 11 | # ``LIBGCRYPT_VERSION`` 12 | # The version of gcrypt that was found 13 | # ``LIBGCRYPT_INCLUDE_DIRS`` 14 | # The gcrypt include directories 15 | # ``LIBGCRYPT_LIBRARIES`` 16 | # The linker libraries needed to use the gcrypt library 17 | 18 | # Copyright 2014 Nicolás Alvarez 19 | # Copyright 2016 Igalia S.L 20 | # 21 | # Redistribution and use in source and binary forms, with or without 22 | # modification, are permitted provided that the following conditions 23 | # are met: 24 | # 25 | # 1. Redistributions of source code must retain the copyright 26 | # notice, this list of conditions and the following disclaimer. 27 | # 2. Redistributions in binary form must reproduce the copyright 28 | # notice, this list of conditions and the following disclaimer in the 29 | # documentation and/or other materials provided with the distribution. 30 | # 3. The name of the author may not be used to endorse or promote products 31 | # derived from this software without specific prior written permission. 32 | # 33 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 34 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 35 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 36 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 37 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 38 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 39 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 40 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 42 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | find_program(LIBGCRYPTCONFIG_SCRIPT NAMES libgcrypt-config) 45 | if (LIBGCRYPTCONFIG_SCRIPT) 46 | execute_process( 47 | COMMAND "${LIBGCRYPTCONFIG_SCRIPT}" --prefix 48 | RESULT_VARIABLE CONFIGSCRIPT_RESULT 49 | OUTPUT_VARIABLE PREFIX 50 | OUTPUT_STRIP_TRAILING_WHITESPACE 51 | ) 52 | if (CONFIGSCRIPT_RESULT EQUAL 0) 53 | set(LIBGCRYPT_LIB_HINT "${PREFIX}/lib") 54 | set(LIBGCRYPT_INCLUDE_HINT "${PREFIX}/include") 55 | endif () 56 | endif () 57 | 58 | find_library(LIBGCRYPT_LIBRARY 59 | NAMES gcrypt 60 | HINTS ${LIBGCRYPT_LIB_HINT} 61 | ) 62 | find_path(LIBGCRYPT_INCLUDE_DIR 63 | NAMES gcrypt.h 64 | HINTS ${LIBGCRYPT_INCLUDE_HINT} 65 | ) 66 | 67 | if (LIBGCRYPT_INCLUDE_DIR) 68 | file(STRINGS ${LIBGCRYPT_INCLUDE_DIR}/gcrypt.h GCRYPT_H REGEX "^#define GCRYPT_VERSION ") 69 | string(REGEX REPLACE "^#define GCRYPT_VERSION \"(.*)\".*$" "\\1" LIBGCRYPT_VERSION "${GCRYPT_H}") 70 | endif () 71 | 72 | include(FindPackageHandleStandardArgs) 73 | 74 | find_package_handle_standard_args(LibGcrypt 75 | FOUND_VAR LIBGCRYPT_FOUND 76 | REQUIRED_VARS LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR 77 | VERSION_VAR LIBGCRYPT_VERSION 78 | ) 79 | if (LIBGCRYPT_FOUND) 80 | set(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY}) 81 | set(LIBGCRYPT_INCLUDE_DIRS ${LIBGCRYPT_INCLUDE_DIR}) 82 | endif () 83 | 84 | mark_as_advanced(LIBGCRYPT_LIBRARY LIBGCRYPT_INCLUDE_DIR LIBGCRYPTCONFIG_SCRIPT) 85 | 86 | include(FeatureSummary) 87 | set_package_properties(LibGcrypt PROPERTIES 88 | DESCRIPTION "A general purpose cryptographic library based on the code from GnuPG." 89 | URL "http://www.gnu.org/software/libgcrypt/" 90 | ) 91 | 92 | -------------------------------------------------------------------------------- /source/cmake/FindLibNotify.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find LibNotify 2 | # This module defines the following variables: 3 | # 4 | # LIBNOTIFY_FOUND - LibNotify was found 5 | # LIBNOTIFY_INCLUDE_DIRS - the LibNotify include directories 6 | # LIBNOTIFY_LIBRARIES - link these to use LibNotify 7 | # 8 | # Copyright (C) 2012 Raphael Kubo da Costa 9 | # Copyright (C) 2014 Collabora Ltd. 10 | # 11 | # Redistribution and use in source and binary forms, with or without 12 | # modification, are permitted provided that the following conditions 13 | # are met: 14 | # 1. Redistributions of source code must retain the above copyright 15 | # notice, this list of conditions and the following disclaimer. 16 | # 2. Redistributions in binary form must reproduce the above copyright 17 | # notice, this list of conditions and the following disclaimer in the 18 | # documentation and/or other materials provided with the distribution. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 21 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | find_package(PkgConfig QUIET) 33 | pkg_check_modules(LIBNOTIFY QUIET libnotify) 34 | 35 | find_path(LIBNOTIFY_INCLUDE_DIRS 36 | NAMES notify.h 37 | HINTS ${LIBNOTIFY_INCLUDEDIR} 38 | ${LIBNOTIFY_INCLUDE_DIRS} 39 | PATH_SUFFIXES libnotify 40 | ) 41 | 42 | find_library(LIBNOTIFY_LIBRARIES 43 | NAMES notify 44 | HINTS ${LIBNOTIFY_LIBDIR} 45 | ${LIBNOTIFY_LIBRARY_DIRS} 46 | ) 47 | 48 | include(FindPackageHandleStandardArgs) 49 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibNotify REQUIRED_VARS LIBNOTIFY_INCLUDE_DIRS LIBNOTIFY_LIBRARIES 50 | VERSION_VAR LIBNOTIFY_VERSION) 51 | 52 | mark_as_advanced( 53 | LIBNOTIFY_INCLUDE_DIRS 54 | LIBNOTIFY_LIBRARIES 55 | ) 56 | -------------------------------------------------------------------------------- /source/cmake/FindLibSoup.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find LibSoup 2.4 2 | # This module defines the following variables: 3 | # 4 | # LIBSOUP_FOUND - LibSoup 2.4 was found 5 | # LIBSOUP_INCLUDE_DIRS - the LibSoup 2.4 include directories 6 | # LIBSOUP_LIBRARIES - link these to use LibSoup 2.4 7 | # 8 | # Copyright (C) 2012 Raphael Kubo da Costa 9 | # 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions 12 | # are met: 13 | # 1. Redistributions of source code must retain the above copyright 14 | # notice, this list of conditions and the following disclaimer. 15 | # 2. Redistributions in binary form must reproduce the above copyright 16 | # notice, this list of conditions and the following disclaimer in the 17 | # documentation and/or other materials provided with the distribution. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 20 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 23 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | if (NOT DEFINED LibSoup_FIND_VERSION) 32 | message(FATAL_ERROR "No LibSoup version specified") 33 | endif () 34 | 35 | if (LibSoup_FIND_VERSION VERSION_LESS 2.91) 36 | set(LIBSOUP_API_VERSION "2.4") 37 | else () 38 | set(LIBSOUP_API_VERSION "3.0") 39 | endif () 40 | 41 | # LibSoup does not provide an easy way to retrieve its version other than its 42 | # .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file 43 | # to be found. 44 | find_package(PkgConfig QUIET) 45 | pkg_check_modules(PC_LIBSOUP QUIET "libsoup-${LIBSOUP_API_VERSION}") 46 | 47 | find_path(LIBSOUP_INCLUDE_DIRS 48 | NAMES libsoup/soup.h 49 | HINTS ${PC_LIBSOUP_INCLUDEDIR} 50 | ${PC_LIBSOUP_INCLUDE_DIRS} 51 | PATH_SUFFIXES "libsoup-${LIBSOUP_API_VERSION}" 52 | ) 53 | 54 | find_library(LIBSOUP_LIBRARIES 55 | NAMES "soup-${LIBSOUP_API_VERSION}" 56 | HINTS ${PC_LIBSOUP_LIBDIR} 57 | ${PC_LIBSOUP_LIBRARY_DIRS} 58 | ) 59 | 60 | include(FindPackageHandleStandardArgs) 61 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibSoup REQUIRED_VARS LIBSOUP_INCLUDE_DIRS LIBSOUP_LIBRARIES 62 | VERSION_VAR PC_LIBSOUP_VERSION) 63 | 64 | mark_as_advanced( 65 | LIBSOUP_INCLUDE_DIRS 66 | LIBSOUP_LIBRARIES 67 | ) 68 | -------------------------------------------------------------------------------- /source/cmake/FindLibseccomp.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libseccomp 2 | # Once done, this will define 3 | # 4 | # LIBSECCOMP_FOUND - system has libseccomp 5 | # LIBSECCOMP_INCLUDE_DIRS - the libseccomp include drectories 6 | # LIBSECCOMP_LIBRARIES - link these to use libseccomp 7 | # 8 | # Copyright (C) 2018 Igalia S.L. 9 | # 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions 12 | # are met: 13 | # 1. Redistributions of source code must retain the above copyright 14 | # notice, this list of conditions and the following disclaimer. 15 | # 2. Redistributions in binary form must reproduce the above copyright 16 | # notice, this list of conditions and the following disclaimer in the 17 | # documentation and/or other materials provided with the distribution. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 20 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 23 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | find_package(PkgConfig QUIET) 32 | pkg_check_modules(PC_LIBSECCOMP libseccomp) 33 | 34 | find_path(LIBSECCOMP_INCLUDE_DIRS 35 | NAMES seccomp.h 36 | HINTS ${PC_LIBSECCOMP_INCLUDEDIR} 37 | ) 38 | 39 | find_library(LIBSECCOMP_LIBRARIES 40 | NAMES seccomp 41 | HINTS ${PC_LIBSECCOMP_LIBDIR} 42 | ) 43 | 44 | include(FindPackageHandleStandardArgs) 45 | find_package_handle_standard_args(Libseccomp 46 | REQUIRED_VARS LIBSECCOMP_LIBRARIES 47 | FOUND_VAR LIBSECCOMP_FOUND 48 | VERSION_VAR PC_LIBSECCOMP_VERSION) 49 | 50 | mark_as_advanced( 51 | LIBSECCOMP_INCLUDE_DIRS 52 | LIBSECCOMP_LIBRARIES 53 | ) 54 | -------------------------------------------------------------------------------- /source/cmake/FindLibsecret.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libsecret 2 | # Once done, this will define 3 | # 4 | # LIBSECRET_FOUND - system has libsecret 5 | # LIBSECRET_INCLUDE_DIRS - the libsecret include directories 6 | # LIBSECRET_LIBRARIES - link these to use libsecret 7 | # 8 | # Copyright (C) 2012 Raphael Kubo da Costa 9 | # Copyright (C) 2014 Igalia S.L. 10 | # 11 | # Redistribution and use in source and binary forms, with or without 12 | # modification, are permitted provided that the following conditions 13 | # are met: 14 | # 1. Redistributions of source code must retain the above copyright 15 | # notice, this list of conditions and the following disclaimer. 16 | # 2. Redistributions in binary form must reproduce the above copyright 17 | # notice, this list of conditions and the following disclaimer in the 18 | # documentation and/or other materials provided with the distribution. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 21 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 24 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | find_package(PkgConfig QUIET) 33 | pkg_check_modules(LIBSECRET libsecret-1) 34 | 35 | set(VERSION_OK TRUE) 36 | if (LIBSECRET_VERSION) 37 | if (LIBSECRET_FIND_VERSION_EXACT) 38 | if (NOT("${LIBSECRET_FIND_VERSION}" VERSION_EQUAL "${LIBSECRET_VERSION}")) 39 | set(VERSION_OK FALSE) 40 | endif () 41 | else () 42 | if ("${LIBSECRET_VERSION}" VERSION_LESS "${LIBSECRET_FIND_VERSION}") 43 | set(VERSION_OK FALSE) 44 | endif () 45 | endif () 46 | endif () 47 | 48 | include(FindPackageHandleStandardArgs) 49 | find_package_handle_standard_args(Libsecret REQUIRED_VARS LIBSECRET_INCLUDE_DIRS LIBSECRET_LIBRARIES VERSION_OK 50 | FOUND_VAR LIBSECRET_FOUND) 51 | -------------------------------------------------------------------------------- /source/cmake/FindLibtasn1.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libtasn1. 2 | # Once done, this will define 3 | # 4 | # LIBTASN1_INCLUDE_DIRS - the libtasn1 include directories 5 | # LIBTASN1_LIBRARIES - the libtasn1 libraries. 6 | # 7 | # Copyright (C) 2017 Metrological Group B.V. 8 | # Copyright (C) 2017 Igalia S.L. 9 | # 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions 12 | # are met: 13 | # 1. Redistributions of source code must retain the above copyright 14 | # notice, this list of conditions and the following disclaimer. 15 | # 2. Redistributions in binary form must reproduce the above copyright 16 | # notice, this list of conditions and the following disclaimer in the 17 | # documentation and/or other materials provided with the distribution. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 29 | # THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | find_package(PkgConfig QUIET) 32 | pkg_check_modules(PC_LIBTASN1 libtasn1) 33 | 34 | find_path(LIBTASN1_INCLUDE_DIRS 35 | NAMES libtasn1.h 36 | HINTS ${PC_LIBTASN1_INCLUDEDIR} ${PC_LIBTASN1_INCLUDE_DIRS} 37 | ) 38 | 39 | find_library(LIBTASN1_LIBRARIES 40 | NAMES tasn1 41 | HINTS ${PC_LIBTASN1_LIBDIR} ${PC_LIBTASN1_LIBRARY_DIRS} 42 | ) 43 | 44 | include(FindPackageHandleStandardArgs) 45 | find_package_handle_standard_args(Libtasn1 REQUIRED_VARS LIBTASN1_LIBRARIES 46 | FOUND_VAR LIBTASN1_FOUND) 47 | 48 | mark_as_advanced(LIBTASN1_INCLUDE_DIRS LIBTASN1_LIBRARIES) 49 | -------------------------------------------------------------------------------- /source/cmake/FindMySQLClient.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find MySQLClient 2 | # 3 | # Copyright (C) 2020 Beijing FMSoft Technologies Co., Ltd. 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with this program. If not, see . 17 | # 18 | # Or, 19 | # 20 | # As this component is a program released under LGPLv3, which claims 21 | # explicitly that the program could be modified by any end user 22 | # even if the program is conveyed in non-source form on the system it runs. 23 | # Generally, if you distribute this program in embedded devices, 24 | # you might not satisfy this condition. Under this situation or you can 25 | # not accept any condition of LGPLv3, you need to get a commercial license 26 | # from FMSoft, along with a patent license for the patents owned by FMSoft. 27 | # 28 | # If you have got a commercial/patent license of this program, please use it 29 | # under the terms and conditions of the commercial license. 30 | # 31 | # For more information about the commercial license and patent license, 32 | # please refer to 33 | # . 34 | # 35 | # Also note that the LGPLv3 license does not apply to any entity in the 36 | # Exception List published by Beijing FMSoft Technologies Co., Ltd. 37 | # 38 | # If you are or the entity you represent is listed in the Exception List, 39 | # the above open source or free software license does not apply to you 40 | # or the entity you represent. Regardless of the purpose, you should not 41 | # use the software in any way whatsoever, including but not limited to 42 | # downloading, viewing, copying, distributing, compiling, and running. 43 | # If you have already downloaded it, you MUST destroy all of its copies. 44 | # 45 | # The Exception List is published by FMSoft and may be updated 46 | # from time to time. For more information, please see 47 | # . 48 | 49 | # use pkg-config to get the directories and then use these values 50 | # in the find_path() and find_library() calls 51 | if (NOT WIN32) 52 | find_package(PkgConfig) 53 | 54 | pkg_check_modules(PC_MYSQLCLIENT mysqlclient) 55 | 56 | set(MYSQLCLIENT_DEFINITIONS ${PC_MYSQLCLIENT_CFLAGS_OTHER}) 57 | set(MYSQLCLIENT_VERSION "${PC_MYSQLCLIENT_VERSION}") 58 | endif (NOT WIN32) 59 | 60 | find_path(MYSQLCLIENT_INCLUDE_DIR NAMES mysql.h 61 | PATHS 62 | ${PC_MYSQLCLIENT_INCLUDEDIR} 63 | ${PC_MYSQLCLIENT_INCLUDE_DIRS} 64 | ) 65 | 66 | find_library(MYSQLCLIENT_LIBRARIES NAMES mysqlclient 67 | PATHS 68 | ${PC_MYSQLCLIENT_LIBDIR} 69 | ${PC_MYSQLCLIENT_LIBRARY_DIRS} 70 | ) 71 | 72 | include(FindPackageHandleStandardArgs) 73 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQLClient 74 | REQUIRED_VARS MYSQLCLIENT_INCLUDE_DIR MYSQLCLIENT_LIBRARIES 75 | VERSION_VAR MYSQLCLIENT_VERSION) 76 | 77 | # show the MYSQLCLIENT_INCLUDE_DIR and MYSQLCLIENT_LIBRARIES variables only in the advanced view 78 | mark_as_advanced( 79 | MYSQLCLIENT_INCLUDE_DIR 80 | MYSQLCLIENT_LIBRARIES 81 | ) 82 | -------------------------------------------------------------------------------- /source/cmake/FindNghttp2.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find nghttp2 2 | # This module defines the following variables: 3 | # 4 | # NGHTTP2_FOUND - nghttp2 was found 5 | # NGHTTP2_INCLUDE_DIRS - the nghttp2 include directories 6 | # NGHTTP2_LIBRARIES - link these to use nghttp2 7 | # 8 | # Copyright (C) 2018 Sony Interactive Entertainment Inc. 9 | # 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions 12 | # are met: 13 | # 1. Redistributions of source code must retain the above copyright 14 | # notice, this list of conditions and the following disclaimer. 15 | # 2. Redistributions in binary form must reproduce the above copyright 16 | # notice, this list of conditions and the following disclaimer in the 17 | # documentation and/or other materials provided with the distribution. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 20 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 23 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | find_package(PkgConfig QUIET) 32 | pkg_check_modules(PC_NGHTTP2 QUIET nghttp2) 33 | 34 | find_path(NGHTTP2_INCLUDE_DIRS 35 | NAMES nghttp2.h 36 | HINTS ${PC_NGHTTP2_INCLUDEDIR} 37 | ${PC_NGHTTP2_INCLUDE_DIRS} 38 | PATH_SUFFIXES nghttp2 39 | ) 40 | 41 | find_library(NGHTTP2_LIBRARIES 42 | NAMES nghttp2 43 | HINTS ${PC_NGHTTP2_LIBDIR} 44 | ${PC_NGHTTP2_LIBRARY_DIRS} 45 | ) 46 | 47 | if (NGHTTP2_INCLUDE_DIRS) 48 | if (EXISTS "${NGHTTP2_INCLUDE_DIRS}/nghttp2ver.h") 49 | file(READ "${NGHTTP2_INCLUDE_DIRS}/nghttp2ver.h" _nghttp2_version_content) 50 | 51 | string(REGEX MATCH "#define +NGHTTP2_VERSION +\"([0-9]+\.[0-9]+\.[0-9]+)\"" _dummy "${_nghttp2_version_content}") 52 | set(NGHTTP2_VERSION "${CMAKE_MATCH_1}") 53 | endif () 54 | endif () 55 | 56 | include(FindPackageHandleStandardArgs) 57 | find_package_handle_standard_args(Nghttp2 REQUIRED_VARS NGHTTP2_INCLUDE_DIRS NGHTTP2_LIBRARIES 58 | VERSION_VAR NGHTTP2_VERSION) 59 | 60 | mark_as_advanced( 61 | NGHTTP2_INCLUDE_DIRS 62 | NGHTTP2_LIBRARIES 63 | ) 64 | -------------------------------------------------------------------------------- /source/cmake/FindPerlModules.cmake: -------------------------------------------------------------------------------- 1 | #.rst: 2 | # FindPerlModules 3 | # --------------- 4 | # 5 | # Check that Perl has certain modules available. 6 | # 7 | # If PERL_EXECUTABLE is set, uses that, otherwise calls the Perl find module. 8 | # 9 | # To use, pass the perl module names (in the form you would use in a Perl 10 | # ``use`` statement) as components. 11 | # 12 | # This will define the following variables: 13 | # 14 | # ``Perl__FOUND`` 15 | # True if the given Perl module could be loaded by Perl 16 | # 17 | # where ```` is either the name passed as a component, or a version 18 | # with ``::`` replaced by ``_``. 19 | 20 | # Copyright 2015 Alex Merry 21 | # 22 | # Redistribution and use in source and binary forms, with or without 23 | # modification, are permitted provided that the following conditions 24 | # are met: 25 | # 1. Redistributions of source code must retain the above copyright 26 | # notice, this list of conditions and the following disclaimer. 27 | # 2. Redistributions in binary form must reproduce the above copyright 28 | # notice, this list of conditions and the following disclaimer in the 29 | # documentation and/or other materials provided with the distribution. 30 | # 3. Neither the name of the University nor the names of its contributors 31 | # may be used to endorse or promote products derived from this software 32 | # without specific prior written permission. 33 | # 34 | # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 35 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 36 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 37 | # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 38 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 39 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 40 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 41 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 42 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 43 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 44 | # SUCH DAMAGE. 45 | 46 | if (NOT PERL_EXECUTABLE) 47 | find_package(Perl) 48 | endif () 49 | 50 | include(FindPackageHandleStandardArgs) 51 | 52 | if (PERL_EXECUTABLE) 53 | set(PerlModules_all_modules_found TRUE) 54 | foreach (_comp ${PerlModules_FIND_COMPONENTS}) 55 | execute_process( 56 | COMMAND ${PERL_EXECUTABLE} -e "use ${_comp}" 57 | RESULT_VARIABLE _result 58 | OUTPUT_QUIET 59 | ERROR_QUIET 60 | ) 61 | if (_result EQUAL 0) 62 | set(PerlModules_${_comp}_FOUND TRUE) 63 | else () 64 | set(PerlModules_${_comp}_FOUND FALSE) 65 | set(PerlModules_all_modules_found FALSE) 66 | endif () 67 | endforeach () 68 | endif () 69 | 70 | find_package_handle_standard_args(PerlModules 71 | FOUND_VAR 72 | PerlModules_FOUND 73 | REQUIRED_VARS 74 | PerlModules_all_modules_found 75 | HANDLE_COMPONENTS 76 | ) 77 | 78 | include(FeatureSummary) 79 | set_package_properties(PerlModules PROPERTIES 80 | URL "http://www.cpan.org" 81 | ) 82 | -------------------------------------------------------------------------------- /source/cmake/FindSystemd.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Igalia S.L. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # 1. Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # 2. Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # 12 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS 13 | # IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 14 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS 16 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 19 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 20 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 21 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 22 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | #[=======================================================================[.rst: 25 | FindSystemd 26 | ----------- 27 | 28 | Find Systemd headers and libraries. 29 | 30 | Imported Targets 31 | ^^^^^^^^^^^^^^^^ 32 | 33 | ``Systemd::Systemd`` 34 | The Systemd library, if found. 35 | 36 | Result Variables 37 | ^^^^^^^^^^^^^^^^ 38 | 39 | This will define the following variables in your project: 40 | 41 | ``Systemd_FOUND`` 42 | true if (the requested version of) Systemd is available. 43 | ``Systemd_VERSION`` 44 | the version of Systemd. 45 | ``Systemd_LIBRARIES`` 46 | the libraries to link against to use Systemd. 47 | ``Systemd_INCLUDE_DIRS`` 48 | where to find the Systemd headers. 49 | ``Systemd_COMPILE_OPTIONS`` 50 | this should be passed to target_compile_options(), if the 51 | target is not used for linking 52 | 53 | #]=======================================================================] 54 | 55 | find_package(PkgConfig QUIET) 56 | 57 | pkg_check_modules(PC_SYSTEMD QUIET libsystemd) 58 | set(Systemd_COMPILE_OPTIONS ${PC_SYSTEMD_CFLAGS_OTHER}) 59 | set(Systemd_VERSION ${PC_SYSTEMD_VERSION}) 60 | 61 | find_path(Systemd_INCLUDE_DIR 62 | NAMES systemd/sd-journal.h 63 | HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS} 64 | ) 65 | 66 | find_library(Systemd_LIBRARY 67 | NAMES ${Systemd_NAMES} systemd 68 | HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS} 69 | ) 70 | 71 | include(FindPackageHandleStandardArgs) 72 | find_package_handle_standard_args(Systemd 73 | FOUND_VAR Systemd_FOUND 74 | REQUIRED_VARS Systemd_LIBRARY Systemd_INCLUDE_DIR 75 | VERSION_VAR Systemd_VERSION 76 | ) 77 | 78 | if (Systemd_LIBRARY AND NOT TARGET Systemd::Systemd) 79 | add_library(Systemd::Systemd UNKNOWN IMPORTED GLOBAL) 80 | set_target_properties(Systemd::Systemd PROPERTIES 81 | IMPORTED_LOCATION "${Systemd_LIBRARY}" 82 | INTERFACE_COMPILE_OPTIONS "${Systemd_COMPILE_OPTIONS}" 83 | INTERFACE_INCLUDE_DIRECTORIES "${Systemd_INCLUDE_DIR}" 84 | ) 85 | endif () 86 | 87 | mark_as_advanced(Systemd_INCLUDE_DIR Systemd_LIBRARY) 88 | 89 | if (Systemd_FOUND) 90 | set(Systemd_LIBRARIES ${Systemd_LIBRARY}) 91 | set(Systemd_INCLUDE_DIRS ${Systemd_INCLUDE_DIR}) 92 | endif () 93 | -------------------------------------------------------------------------------- /source/cmake/FindThunder.cmake: -------------------------------------------------------------------------------- 1 | #.rst 2 | # FindThunder 3 | # ------------- 4 | # 5 | # Finds the Thunder library. 6 | # 7 | # This will define the following variables: 8 | # 9 | # ``THUNDER_FOUND`` 10 | # True if the requested version of Thunder was found 11 | # ``THUNDER_VERSION`` 12 | # The version of Thunder that was found 13 | # ``THUNDER_INCLUDE_DIRS`` 14 | # The Thunder include directories 15 | # ``THUNDER_LIBRARIES`` 16 | # The linker libraries needed to use the Thunder library 17 | # 18 | # Copyright (C) 2020 Metrological 19 | # Copyright (C) 2020 Igalia S.L 20 | # 21 | # Redistribution and use in source and binary forms, with or without 22 | # modification, are permitted provided that the following conditions 23 | # are met: 24 | # 25 | # 1. Redistributions of source code must retain the copyright 26 | # notice, this list of conditions and the following disclaimer. 27 | # 2. Redistributions in binary form must reproduce the copyright 28 | # notice, this list of conditions and the following disclaimer in the 29 | # documentation and/or other materials provided with the distribution. 30 | # 3. The name of the author may not be used to endorse or promote products 31 | # derived from this software without specific prior written permission. 32 | # 33 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 34 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 35 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 36 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 37 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 38 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 39 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 40 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 42 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | find_library(THUNDER_LIBRARY 45 | NAMES libocdm.so 46 | ) 47 | find_path(THUNDER_INCLUDE_DIR 48 | NAMES open_cdm.h 49 | PATH_SUFFIXES "WPEFramework/ocdm/" 50 | ) 51 | 52 | include(FindPackageHandleStandardArgs) 53 | 54 | find_package_handle_standard_args(Thunder 55 | FOUND_VAR THUNDER_FOUND 56 | REQUIRED_VARS THUNDER_LIBRARY THUNDER_INCLUDE_DIR 57 | ) 58 | if (THUNDER_FOUND) 59 | set(THUNDER_LIBRARIES ${THUNDER_LIBRARY}) 60 | set(THUNDER_INCLUDE_DIRS ${THUNDER_INCLUDE_DIR}) 61 | endif () 62 | 63 | mark_as_advanced(THUNDER_LIBRARY THUNDER_INCLUDE_DIR) 64 | 65 | include(FeatureSummary) 66 | set_package_properties(Thunder PROPERTIES 67 | DESCRIPTION "Thunder DRM framework" 68 | URL "https://github.com/rdkcentral/Thunder" 69 | ) 70 | -------------------------------------------------------------------------------- /source/cmake/GlobalCCache.cmake: -------------------------------------------------------------------------------- 1 | # Enable ccache by default, if installed. To disable it you can: 2 | # if using script build-webkit: pass --no-use-ccache 3 | # if using cmake: set environment variable WK_USE_CCACHE=NO 4 | if (NOT "$ENV{WK_USE_CCACHE}" STREQUAL "NO") 5 | find_program(CCACHE_FOUND ccache) 6 | if (CCACHE_FOUND) 7 | if (PORT STREQUAL "Mac") 8 | set(CCACHE ${CMAKE_SOURCE_DIR}/Tools/ccache/ccache-wrapper) 9 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND}) 10 | else () 11 | if (NOT DEFINED ENV{CCACHE_SLOPPINESS}) 12 | set(ENV{CCACHE_SLOPPINESS} time_macros) 13 | endif () 14 | # FIXME: readlink -f isn't supported on macOS. https://bugs.webkit.org/show_bug.cgi?id=208379 15 | execute_process(COMMAND readlink -f ${CMAKE_CXX_COMPILER} RESULT_VARIABLE READLINK_RETCODE OUTPUT_VARIABLE REAL_CXX_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) 16 | execute_process(COMMAND which ${CCACHE_FOUND} RESULT_VARIABLE WHICH_RETCODE OUTPUT_VARIABLE REAL_CCACHE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) 17 | if (${WHICH_RETCODE} EQUAL 0 AND ${READLINK_RETCODE} EQUAL 0 AND "${REAL_CXX_PATH}" STREQUAL "${REAL_CCACHE_PATH}") 18 | message(STATUS "Enabling ccache: Compiler path already pointing to ccache. Not setting ccache prefix.") 19 | else () 20 | message(STATUS "Enabling ccache: Setting ccache prefix for compiler.") 21 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND}) 22 | endif () 23 | endif () 24 | else () 25 | message(STATUS "Enabling ccache: Couldn't find ccache program. Not enabling it.") 26 | endif () 27 | endif () 28 | 29 | if (("$ENV{XGUIPRO_USE_SCCACHE}" STREQUAL "1") OR DEFINED ENV{SCCACHE_REDIS} OR DEFINED ENV{SCCACHE_BUCKET} 30 | OR DEFINED ENV{SCCACHE_MEMCACHED} OR DEFINED ENV{SCCACHE_GCS_BUCKET} OR DEFINED ENV{SCCACHE_AZURE_CONNECTION_STRING}) 31 | find_program(SCCACHE_FOUND sccache) 32 | if (SCCACHE_FOUND) 33 | message(STATUS "Enabling sccache as prefix for compiler.") 34 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${SCCACHE_FOUND}) 35 | endif () 36 | endif () 37 | -------------------------------------------------------------------------------- /source/cmake/GlobalCommon.cmake: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # This file is included individually from various subdirectories (JSC, WTF, 3 | # XCore, XKit) in order to allow scripts to build only part of XGUIPRO. 4 | # We want to run this file only once. 5 | # ----------------------------------------------------------------------------- 6 | if (NOT HAS_RUN_XGUIPRO_COMMON) 7 | set(HAS_RUN_XGUIPRO_COMMON TRUE) 8 | 9 | # ----------------------------------------------------------------------------- 10 | # Default output directories, which can be overwritten by ports 11 | #------------------------------------------------------------------------------ 12 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 13 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 14 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 15 | 16 | # ----------------------------------------------------------------------------- 17 | # Find common packages (used by all ports) 18 | # ----------------------------------------------------------------------------- 19 | if (WIN32) 20 | list(APPEND CMAKE_PROGRAM_PATH $ENV{SystemDrive}/cygwin/bin) 21 | endif () 22 | 23 | find_package(Perl 5.10.0) 24 | 25 | set(Python_ADDITIONAL_VERSIONS 3) 26 | find_package(Python3 COMPONENTS Interpreter) 27 | 28 | # ----------------------------------------------------------------------------- 29 | # Helper macros and feature defines 30 | # ----------------------------------------------------------------------------- 31 | 32 | # To prevent multiple inclusion, most modules should be included once here. 33 | include(CheckCCompilerFlag) 34 | include(CheckCXXCompilerFlag) 35 | include(CheckCXXSourceCompiles) 36 | include(CheckFunctionExists) 37 | include(CheckIncludeFile) 38 | include(CheckSymbolExists) 39 | include(CheckStructHasMember) 40 | include(CheckTypeSize) 41 | include(CMakeDependentOption) 42 | include(CMakeParseArguments) 43 | include(ProcessorCount) 44 | include(VersioningUtils) 45 | 46 | include(GlobalPackaging) 47 | include(GlobalMacros) 48 | include(GlobalFS) 49 | include(GlobalCCache) 50 | include(GlobalCompilerFlags) 51 | include(GlobalStaticAnalysis) 52 | include(GlobalFeatures) 53 | include(GlobalFindPackage) 54 | 55 | include(OptionsCommon) 56 | include(Options${PORT}) 57 | 58 | # ----------------------------------------------------------------------------- 59 | # Job pool to avoid running too many memory hungry linker processes 60 | # ----------------------------------------------------------------------------- 61 | if (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "MinSizeRel") 62 | set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=4) 63 | else () 64 | set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=2) 65 | endif () 66 | set(CMAKE_JOB_POOL_LINK link_pool_jobs) 67 | 68 | # ----------------------------------------------------------------------------- 69 | # config.h 70 | # ----------------------------------------------------------------------------- 71 | CREATE_CONFIGURATION_HEADER() 72 | endif () 73 | -------------------------------------------------------------------------------- /source/cmake/GlobalDist.cmake: -------------------------------------------------------------------------------- 1 | macro(XGUIPRO_DECLARE_DIST_TARGETS _port _tarball_prefix _manifest) 2 | find_package(Xz REQUIRED) 3 | 4 | configure_file( 5 | ${_manifest} 6 | ${CMAKE_BINARY_DIR}/manifest.txt 7 | ) 8 | 9 | add_custom_target(distcheck 10 | COMMENT "Checking release tarball: ${_tarball_prefix}-${PROJECT_VERSION}.tar" 11 | DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt 12 | DEPENDS xGUIPro 13 | DEPENDS Documentation 14 | COMMAND ${TOOLS_DIR}/Scripts/make-dist 15 | --check --port=${_port} 16 | --tarball-name=${_tarball_prefix} 17 | --source-dir=${CMAKE_SOURCE_DIR} 18 | --build-dir=${CMAKE_BINARY_DIR} 19 | --version=${PROJECT_VERSION} 20 | ${CMAKE_BINARY_DIR}/manifest.txt 21 | COMMAND ${XZ_EXECUTABLE} -evfQ 22 | ${CMAKE_BINARY_DIR}/${_tarball_prefix}-${PROJECT_VERSION}.tar 23 | USES_TERMINAL 24 | VERBATIM 25 | ) 26 | 27 | add_custom_command( 28 | COMMENT "Creating release tarball: ${_tarball_prefix}-${PROJECT_VERSION}.tar.xz" 29 | OUTPUT ${CMAKE_BINARY_DIR}/${_tarball_prefix}-${PROJECT_VERSION}.tar.xz 30 | MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/manifest.txt 31 | COMMAND ${TOOLS_DIR}/Scripts/make-dist 32 | --tarball-name=${_tarball_prefix} 33 | --source-dir=${CMAKE_SOURCE_DIR} 34 | --build-dir=${CMAKE_BINARY_DIR} 35 | --version=${PROJECT_VERSION} 36 | ${CMAKE_BINARY_DIR}/manifest.txt 37 | COMMAND ${XZ_EXECUTABLE} -evfQ 38 | ${CMAKE_BINARY_DIR}/${_tarball_prefix}-${PROJECT_VERSION}.tar 39 | USES_TERMINAL 40 | VERBATIM 41 | ) 42 | 43 | add_custom_target(dist 44 | DEPENDS ${CMAKE_BINARY_DIR}/${_tarball_prefix}-${PROJECT_VERSION}.tar.xz 45 | DEPENDS xGUIPro 46 | DEPENDS Documentation 47 | ) 48 | endmacro() 49 | -------------------------------------------------------------------------------- /source/cmake/GlobalFS.cmake: -------------------------------------------------------------------------------- 1 | if (NOT WTF_DIR) 2 | set(WTF_DIR "${CMAKE_SOURCE_DIR}/source/wtf") 3 | endif () 4 | if (NOT XGUIPRO_LIB_DIR) 5 | set(XGUIPRO_LIB_DIR "${CMAKE_SOURCE_DIR}/source/lib") 6 | endif () 7 | if (NOT XGUIPRO_BIN_DIR) 8 | set(XGUIPRO_BIN_DIR "${CMAKE_SOURCE_DIR}/source/bin") 9 | endif () 10 | if (NOT XGUIPRO_DOC_DIR) 11 | set(XGUIPRO_DOC_DIR "${CMAKE_SOURCE_DIR}/source/doc") 12 | endif () 13 | if (NOT XGUIPRO_MISC_DIR) 14 | set(XGUIPRO_MISC_DIR "${CMAKE_SOURCE_DIR}/source/misc") 15 | endif () 16 | if (NOT THIRDPARTY_DIR) 17 | set(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/source/third-party") 18 | endif () 19 | if (NOT TOOLS_DIR) 20 | set(TOOLS_DIR "${CMAKE_SOURCE_DIR}/tools") 21 | endif () 22 | 23 | set(DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources") 24 | set(WTF_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WTF") 25 | set(xGUIPro_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/xGUIPro") 26 | set(xGUIProTestRunner_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/xGUIProTestRunner") 27 | 28 | set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders) 29 | 30 | set(bmalloc_FRAMEWORK_HEADERS_DIR ${FORWARDING_HEADERS_DIR}) 31 | set(WTF_FRAMEWORK_HEADERS_DIR ${FORWARDING_HEADERS_DIR}) 32 | set(xGUIPro_FRAMEWORK_HEADERS_DIR ${FORWARDING_HEADERS_DIR}) 33 | set(xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR ${FORWARDING_HEADERS_DIR}) 34 | -------------------------------------------------------------------------------- /source/cmake/GlobalStaticAnalysis.cmake: -------------------------------------------------------------------------------- 1 | 2 | option(ANALYZERS "Static analysis tools to run on the build" "") 3 | 4 | if ("clang-tidy" IN_LIST ANALYZERS) 5 | find_program(ClangTidy_EXE 6 | NAMES clang-tidy 7 | PATHS 8 | "C:/Program Files/LLVM/bin" 9 | "C:/Program Files (x86)/LLVM/bin" 10 | ) 11 | if (ClangTidy_EXE) 12 | message(STATUS "Found clang-tidy: ${ClangTidy_EXE}") 13 | else () 14 | message(FATAL_ERROR "Could not find clang-tidy static analyzer") 15 | endif () 16 | endif () 17 | 18 | if ("iwyu" IN_LIST ANALYZERS) 19 | find_program(IWYU_EXE 20 | NAMES iwyu include-what-you-use 21 | PATHS 22 | "C:/Program Files/include-what-you-use/bin" 23 | "C:/Program Files (x86)/include-what-you-use/bin" 24 | ) 25 | if (IWYU_EXE) 26 | message(STATUS "Found include-what-you-use: ${IWYU_EXE}") 27 | else () 28 | message(FAT "Could not find include-what-you-use static analyzer") 29 | endif () 30 | endif () 31 | 32 | if ("lwyu" IN_LIST ANALYZERS) 33 | set(CMAKE_LINK_WHAT_YOU_USE ON) 34 | endif () 35 | -------------------------------------------------------------------------------- /source/cmake/GtkDoc.cmake: -------------------------------------------------------------------------------- 1 | # Calls scripts to generate documentation using GTK-Doc. 2 | # DocumentationDependencies variable must be set before calling this macro. 3 | macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args) 4 | add_custom_command( 5 | OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}" 6 | DEPENDS ${DocumentationDependencies} 7 | COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" "LDFLAGS=${CMAKE_EXE_LINKER_FLAGS}" ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/gtkdoc/generate-gtkdoc ${_extra_args} 8 | COMMAND touch ${_stamp_name} 9 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" 10 | VERBATIM 11 | ) 12 | endmacro() 13 | -------------------------------------------------------------------------------- /source/cmake/OptionsMac.cmake: -------------------------------------------------------------------------------- 1 | # FIXME: These should line up with versions in Version.xcconfig 2 | set(XGUIPRO_MAC_VERSION 0.0.1) 3 | set(MACOSX_FRAMEWORK_BUNDLE_VERSION 0.0.1) 4 | 5 | find_package(GLIB 2.44.0 REQUIRED COMPONENTS gio gio-unix gmodule) 6 | find_package(Ncurses 5.0 REQUIRED) 7 | find_package(PurC 0.0.1 REQUIRED) 8 | find_package(LibXml2 2.8.0) 9 | 10 | XGUIPRO_OPTION_BEGIN() 11 | # Private options shared with other xGUIPro ports. Add options here only if 12 | # we need a value different from the default defined in GlobalFeatures.cmake. 13 | 14 | XGUIPRO_OPTION_DEFAULT_PORT_VALUE(ENABLE_XML PUBLIC OFF) 15 | 16 | XGUIPRO_OPTION_END() 17 | 18 | set(xGUIPRo_PKGCONFIG_FILE ${CMAKE_BINARY_DIR}/source/xguipro.pc) 19 | 20 | set(xGUIProTestSupport_LIBRARY_TYPE STATIC) 21 | 22 | -------------------------------------------------------------------------------- /source/cmake/OptionsMiniGUI.cmake: -------------------------------------------------------------------------------- 1 | include(GNUInstallDirs) 2 | 3 | XGUIPRO_OPTION_BEGIN() 4 | 5 | CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(XGUIPRO 0 0 0) 6 | 7 | # These are shared variables, but we special case their definition so that we can use the 8 | # CMAKE_INSTALL_* variables that are populated by the GNUInstallDirs macro. 9 | set(LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Absolute path to library installation directory") 10 | set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Absolute path to executable installation directory") 11 | set(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/xguipro" CACHE PATH "Absolute path to install executables executed by the library") 12 | set(HEADER_INSTALL_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}" CACHE PATH "Absolute path to header installation directory") 13 | set(XGUIPRO_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/xguipro" CACHE PATH "Absolute path to xGUIPro header installation directory") 14 | 15 | add_definitions(-DBUILDING_MINIGUI__=1) 16 | add_definitions(-DBUILDING_LINUX__=1) 17 | add_definitions(-DXGUIPRO_API_VERSION_STRING="${XGUIPRO_API_VERSION}") 18 | 19 | 20 | find_package(GLIB 2.44.0 REQUIRED COMPONENTS gio gio-unix gmodule gobject) 21 | find_package(PurC 0.9.16 REQUIRED) 22 | find_package(DOMRuler 0.9.16 REQUIRED) 23 | find_package(MiniGUI 5.2.0 REQUIRED COMPONENTS mGEff) 24 | find_package(CairoHBD REQUIRED) 25 | 26 | XGUIPRO_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC ON) 27 | XGUIPRO_OPTION_DEFINE(USE_ANIMATION "Whether to enable animation." PUBLIC OFF) 28 | XGUIPRO_OPTION_DEFINE(USE_SCREEN_CAST "Whether to enable screen cast." PUBLIC OFF) 29 | XGUIPRO_OPTION_DEFINE(ENABLE_DNSSD_BROWSING "Whether to enable dnssd browsing." PUBLIC OFF) 30 | XGUIPRO_OPTION_DEFINE(ENABLE_COVER_PAGE "Whether to enable cover page." PUBLIC ON) 31 | 32 | XGUIPRO_OPTION_DEFAULT_PORT_VALUE(USE_SOUP2 PUBLIC ON) 33 | XGUIPRO_OPTION_DEFAULT_PORT_VALUE(USE_SCREEN_CAST PUBLIC ON) 34 | XGUIPRO_OPTION_DEFAULT_PORT_VALUE(ENABLE_COVER_PAGE PUBLIC ON) 35 | 36 | if (USE_SOUP2) 37 | set(SOUP_MINIMUM_VERSION 2.54.0) 38 | set(SOUP_API_VERSION 2.4) 39 | else () 40 | set(SOUP_MINIMUM_VERSION 2.99.9) 41 | set(SOUP_API_VERSION 3.0) 42 | set(ENABLE_SERVER_PRECONNECT ON) 43 | endif () 44 | 45 | if (USE_SCREEN_CAST) 46 | set(ENABLE_DNSSD_BROWSING_DEFAULT OFF) 47 | else () 48 | set(ENABLE_DNSSD_BROWSING_DEFAULT ON) 49 | endif () 50 | 51 | XGUIPRO_OPTION_DEFAULT_PORT_VALUE(ENABLE_DNSSD_BROWSING PUBLIC ${ENABLE_DNSSD_BROWSING_DEFAULT}) 52 | 53 | 54 | find_package(LibSoup ${SOUP_MINIMUM_VERSION}) 55 | 56 | if (NOT LibSoup_FOUND) 57 | if (USE_SOUP2) 58 | message(FATAL_ERROR "libsoup is required.") 59 | else () 60 | message(FATAL_ERROR "libsoup 3 is required. Enable USE_SOUP2 to use libsoup 2 (disables HTTP/2)") 61 | endif () 62 | endif () 63 | 64 | if (USE_SOUP2) 65 | set(JAVASCRIPTCOREHBD_PC_NAME javascriptcorehbd-4.0) 66 | set(WEBKIT2HBD_PC_NAME webkit2hbd-4.0) 67 | set(WEBKIT2HBD_API_VERSION 4.0) 68 | set(WEBKIT2HBD_API_DOC_VERSION 4.0) 69 | else () 70 | set(JAVASCRIPTCOREHBD_PC_NAME javascriptcorehbd-4.1) 71 | set(WEBKIT2HBD_PC_NAME webkit2hbd-4.1) 72 | set(WEBKIT2HBD_API_VERSION 4.1) 73 | # No API changes in 4.1, so keep using the same API documentation. 74 | set(WEBKIT2HBD_API_DOC_VERSION 4.0) 75 | endif () 76 | 77 | find_package(WebKit2HBD 2.34.0 REQUIRED) 78 | 79 | XGUIPRO_OPTION_END() 80 | 81 | set(xGUIPRo_PKGCONFIG_FILE ${CMAKE_BINARY_DIR}/source/xguipro.pc) 82 | 83 | set(xGUIProTestSupport_LIBRARY_TYPE STATIC) 84 | 85 | -------------------------------------------------------------------------------- /source/cmake/OptionsWindows.cmake: -------------------------------------------------------------------------------- 1 | set(WTF_PLATFORM_WIN_CAIRO 1) 2 | 3 | include(OptionsWin) 4 | 5 | find_package(LibXml2 2.9.7 REQUIRED) 6 | find_package(OpenSSL 2.0.0 REQUIRED) 7 | find_package(SQLite3 3.23.1 REQUIRED) 8 | find_package(ZLIB 1.2.11 REQUIRED) 9 | 10 | # TODO: Add a check for HAVE_RSA_PSS for support of CryptoAlgorithmRSA_PSS 11 | # https://bugs.webkit.org/show_bug.cgi?id=206635 12 | 13 | SET_AND_EXPOSE_TO_BUILD(USE_CURL ON) 14 | SET_AND_EXPOSE_TO_BUILD(USE_OPENSSL ON) 15 | SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) 16 | 17 | set(COREFOUNDATION_LIBRARY CFlite) 18 | 19 | add_definitions(-DWTF_PLATFORM_WIN_CAIRO=1) 20 | add_definitions(-DNOCRYPT) 21 | 22 | # Override headers directories 23 | set(WTF_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/WTF/Headers) 24 | set(xGUIPro_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/xGUIPro/Headers) 25 | set(xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR ${CMAKE_BINARY_DIR}/xGUIPro/PrivateHeaders) 26 | 27 | # Override derived sources directories 28 | set(WTF_DERIVED_SOURCES_DIR ${CMAKE_BINARY_DIR}/WTF/DerivedSources) 29 | set(xGUIPro_DERIVED_SOURCES_DIR ${CMAKE_BINARY_DIR}/xGUIPro/DerivedSources) 30 | 31 | # Override library types 32 | set(xGUIPro_LIBRARY_TYPE OBJECT) 33 | set(xGUIProTestSupport_LIBRARY_TYPE OBJECT) 34 | -------------------------------------------------------------------------------- /source/cmake/VersioningUtils.cmake: -------------------------------------------------------------------------------- 1 | macro(SET_PROJECT_VERSION major minor micro) 2 | set(PROJECT_VERSION_MAJOR "${major}") 3 | set(PROJECT_VERSION_MINOR "${minor}") 4 | set(PROJECT_VERSION_MICRO "${micro}") 5 | set(PROJECT_VERSION "${major}.${minor}.${micro}") 6 | endmacro() 7 | 8 | # Libtool library version, not to be confused with API version. 9 | # See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html 10 | macro(CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE library_name current revision age) 11 | math(EXPR ${library_name}_VERSION_MAJOR "${current} - ${age}") 12 | set(${library_name}_VERSION_MINOR ${age}) 13 | set(${library_name}_VERSION_MICRO ${revision}) 14 | set(${library_name}_VERSION ${${library_name}_VERSION_MAJOR}.${age}.${revision}) 15 | endmacro() 16 | -------------------------------------------------------------------------------- /source/cmake/WinTools.make: -------------------------------------------------------------------------------- 1 | install: 2 | xcopy "$(SRCROOT)\*.cmake" "$(DSTROOT)\AppleInternal\tools\cmake" /e/v/i/h/y 3 | xcopy "$(SRCROOT)\tools\scripts\*" "$(DSTROOT)\AppleInternal\tools\scripts" /e/v/i/h/y 4 | xcopy "$(SRCROOT)\tools\vsprops\*" "$(DSTROOT)\AppleInternal\tools\vsprops" /e/v/i/h/y 5 | -------------------------------------------------------------------------------- /source/cmake/target/xGUIPro.cmake: -------------------------------------------------------------------------------- 1 | if (NOT TARGET xGUIPro::xGUIPro) 2 | if (NOT INTERNAL_BUILD) 3 | message(FATAL_ERROR "xGUIPro::xGUIPro target not found") 4 | endif () 5 | 6 | # This should be moved to an if block if the Apple Mac/iOS build moves completely to CMake 7 | # Just assuming Windows for the moment 8 | add_library(xGUIPro::xGUIPro STATIC IMPORTED) 9 | set_target_properties(xGUIPro::xGUIPro PROPERTIES 10 | IMPORTED_LOCATION ${XGUIPRO_LIBRARIES_LINK_DIR}/xGUIPro${DEBUG_SUFFIX}.lib 11 | ) 12 | set(xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR "${CMAKE_SOURCE_DIR}/source/bin") 13 | target_include_directories(xGUIPro::xGUIPro INTERFACE 14 | ${xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR} 15 | ) 16 | endif () 17 | -------------------------------------------------------------------------------- /source/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_property(DIRECTORY . PROPERTY FOLDER "lib") 2 | 3 | include(GlobalCommon) 4 | include(MyMacros.cmake) 5 | 6 | set(xGUIPro_SYSTEM_INCLUDE_DIRECTORIES 7 | ${GLIB_INCLUDE_DIRS} 8 | ) 9 | 10 | set(xGUIPro_PRIVATE_INCLUDE_DIRECTORIES 11 | "${CMAKE_BINARY_DIR}" 12 | "${XGUIPRO_LIB_DIR}" 13 | "${xGUIPro_DERIVED_SOURCES_DIR}" 14 | "${FORWARDING_HEADERS_DIR}" 15 | ) 16 | 17 | # TODO: List the headers should be installed to system here. 18 | set(xGUIPro_INSTALLED_HEADERS 19 | ) 20 | 21 | # TODO: List the directorires which do not contain any platform-dependent C source files 22 | set(xGUIPro_PLATFORM_INDEPENDENT_DIRS 23 | "utils" 24 | ) 25 | 26 | # This macro will append all C/CXX source files in ${xGUIPro_PLATFORM_INDEPENDENT_DIRS} 27 | # to ${xGUIPro_SOURCES} 28 | APPEND_ALL_SOURCE_FILES_IN_DIRLIST(xGUIPro_SOURCES "${xGUIPro_PLATFORM_INDEPENDENT_DIRS}") 29 | 30 | # TODO: List the source files individually. 31 | list(APPEND xGUIPro_SOURCES 32 | ) 33 | 34 | # Put the CXX source files which can be unified in `Sources.txt` 35 | list(APPEND xGUIPro_UNIFIED_SOURCE_LIST_FILES 36 | "Sources.txt" 37 | ) 38 | 39 | set(xGUIPro_LIBRARIES 40 | ${GLIB_LIBRARIES} 41 | ) 42 | 43 | set(xGUIPro_INTERFACE_LIBRARIES xGUIPro) 44 | set(xGUIPro_INTERFACE_INCLUDE_DIRECTORIES ${xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR}) 45 | 46 | XGUIPRO_FRAMEWORK_DECLARE(xGUIPro) 47 | 48 | XGUIPRO_WRAP_SOURCELIST(${xGUIPro_SOURCES}) 49 | 50 | XGUIPRO_COPY_FILES(xGUIPro_CopyPrivateHeaders 51 | DESTINATION ${xGUIPro_PRIVATE_FRAMEWORK_HEADERS_DIR}/xguipro 52 | FILES ${xGUIPro_PRIVATE_FRAMEWORK_HEADERS} 53 | FLATTENED 54 | ) 55 | list(APPEND xGUIPro_INTERFACE_DEPENDENCIES xGUIPro_CopyPrivateHeaders) 56 | # xGUIPro_CopyPrivateHeaders needs to have a direct or indirect 57 | # dependency of xGUIPro target for CMake Visual Studio generator to # eliminate duplicated custom commands. Otherwise, CSSPropertyNames.h 58 | # will be generated in both projects. 59 | if (NOT INTERNAL_BUILD) 60 | add_dependencies(xGUIPro_CopyPrivateHeaders xGUIPro) 61 | add_dependencies(xGUIPro WTF) 62 | endif () 63 | 64 | XGUIPRO_COMPUTE_SOURCES(xGUIPro) 65 | XGUIPRO_FRAMEWORK(xGUIPro) 66 | XGUIPRO_FRAMEWORK_TARGET(xGUIPro) 67 | 68 | # The -ftree-sra optimization (implicit with -O2) causes crashes when 69 | # allocating large chunks of memory using bmalloc on Intel 32bit. 70 | # See https://bugs.webkit.org/show_bug.cgi?id=146440 71 | string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR) 72 | if (CMAKE_COMPILER_IS_GNUCXX AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)$") 73 | XGUIPRO_ADD_TARGET_CXX_FLAGS(xGUIPro -fno-tree-sra) 74 | endif () 75 | 76 | if (${xGUIPro_LIBRARY_TYPE} MATCHES "SHARED") 77 | set_target_properties(xGUIPro PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) 78 | # install(TARGETS xGUIPro DESTINATION "${LIB_INSTALL_DIR}") 79 | endif () 80 | 81 | if (MSVC) 82 | set_target_properties(xGUIPro PROPERTIES 83 | COMPILE_PDB_NAME ${xGUIPro_OUTPUT_NAME} 84 | ) 85 | endif () 86 | 87 | # add_subdirectory(res) 88 | 89 | # install(TARGETS xGUIPro DESTINATION "${LIB_INSTALL_DIR}/") 90 | 91 | # install(FILES ${xGUIPro_INSTALLED_HEADERS} DESTINATION "${HEADER_INSTALL_DIR}/xguipro") 92 | -------------------------------------------------------------------------------- /source/lib/MyMacros.cmake: -------------------------------------------------------------------------------- 1 | # Append the all C files in the specified directory list to the source list 2 | macro(APPEND_ALL_SOURCE_FILES_IN_DIRLIST result) 3 | set(filelist "") 4 | foreach(module ${ARGN}) 5 | list(APPEND filelist ${module}/*.c) 6 | list(APPEND filelist ${module}/*.cpp) 7 | endforeach() 8 | file(GLOB_RECURSE ${result} RELATIVE ${XGUIPRO_LIB_DIR} ${filelist}) 9 | # FOREACH(file ${${result}}) 10 | # message(STATUS ${file}) 11 | # ENDFOREACH() 12 | unset(filelist) 13 | endmacro() 14 | -------------------------------------------------------------------------------- /source/lib/PlatformGTK.cmake: -------------------------------------------------------------------------------- 1 | set(FooBar_OUTPUT_NAME foobar) 2 | 3 | list(APPEND FooBar_PRIVATE_INCLUDE_DIRECTORIES 4 | ) 5 | 6 | list(APPEND FooBar_UNIFIED_SOURCE_LIST_FILES 7 | ) 8 | 9 | list(APPEND FooBar_SOURCES 10 | ) 11 | 12 | list(APPEND FooBar_LIBRARIES 13 | -lpthread 14 | ) 15 | 16 | if (ENABLE_SOCKET_STREAM) 17 | list(APPEND FooBar_SYSTEM_INCLUDE_DIRECTORIES 18 | ${GLIB_INCLUDE_DIRS} 19 | ) 20 | 21 | list(APPEND FooBar_LIBRARIES 22 | ${GLIB_GIO_LIBRARIES} 23 | ${GLIB_LIBRARIES} 24 | ) 25 | endif () 26 | 27 | configure_file(ports/linux/foobar.pc.in ${FooBar_PKGCONFIG_FILE} @ONLY) 28 | install(FILES "${FooBar_PKGCONFIG_FILE}" 29 | DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" 30 | ) 31 | 32 | -------------------------------------------------------------------------------- /source/lib/PlatformMac.cmake: -------------------------------------------------------------------------------- 1 | set(FooBar_OUTPUT_NAME foobar) 2 | 3 | list(APPEND FooBar_PRIVATE_INCLUDE_DIRECTORIES 4 | ) 5 | 6 | list(APPEND FooBar_UNIFIED_SOURCE_LIST_FILES 7 | ) 8 | 9 | list(APPEND FooBar_SOURCES 10 | ) 11 | 12 | list(APPEND FooBar_LIBRARIES 13 | -lpthread 14 | ) 15 | 16 | if (ENABLE_SOCKET_STREAM) 17 | list(APPEND FooBar_SYSTEM_INCLUDE_DIRECTORIES 18 | ) 19 | 20 | list(APPEND FooBar_LIBRARIES 21 | ) 22 | endif () 23 | 24 | configure_file(ports/linux/foobar.pc.in ${FooBar_PKGCONFIG_FILE} @ONLY) 25 | install(FILES "${FooBar_PKGCONFIG_FILE}" 26 | DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" 27 | ) 28 | 29 | -------------------------------------------------------------------------------- /source/lib/PlatformMiniGUI.cmake: -------------------------------------------------------------------------------- 1 | set(FooBar_OUTPUT_NAME foobar) 2 | 3 | list(APPEND FooBar_PRIVATE_INCLUDE_DIRECTORIES 4 | ) 5 | 6 | list(APPEND FooBar_UNIFIED_SOURCE_LIST_FILES 7 | ) 8 | 9 | list(APPEND FooBar_SOURCES 10 | ) 11 | 12 | list(APPEND FooBar_LIBRARIES 13 | -lpthread 14 | ) 15 | 16 | if (ENABLE_SOCKET_STREAM) 17 | list(APPEND FooBar_SYSTEM_INCLUDE_DIRECTORIES 18 | ${GLIB_INCLUDE_DIRS} 19 | ) 20 | 21 | list(APPEND FooBar_LIBRARIES 22 | ${GLIB_GIO_LIBRARIES} 23 | ${GLIB_LIBRARIES} 24 | ) 25 | endif () 26 | 27 | configure_file(ports/linux/foobar.pc.in ${FooBar_PKGCONFIG_FILE} @ONLY) 28 | install(FILES "${FooBar_PKGCONFIG_FILE}" 29 | DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" 30 | ) 31 | 32 | -------------------------------------------------------------------------------- /source/lib/Sources.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HVML/xGUI-Pro/8eada466c4a763a18f26ac8673aa9c802fdf77ed/source/lib/Sources.txt -------------------------------------------------------------------------------- /source/lib/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file config.h 3 | * @author Vincent Wei (https://github.com/VincentWei) 4 | * @date 2022/04/30 5 | * @brief The configuration header file for xGUI Pro. 6 | * 7 | * Copyright (C) 2022 FMSoft 8 | * 9 | * This file is a part of xGUI Pro, an advance HVML renderer based on 10 | * the tailored WebKit. 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE) 27 | #include "cmakeconfig.h" 28 | #endif 29 | 30 | #include 31 | #include 32 | 33 | -------------------------------------------------------------------------------- /source/lib/utils/avl-cmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Felix Fietkau 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | #include 17 | 18 | #include "avl-cmp.h" 19 | 20 | int 21 | avl_strcmp(const void *k1, const void *k2, void *ptr) 22 | { 23 | (void) ptr; 24 | return strcmp(k1, k2); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /source/lib/utils/avl-cmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Felix Fietkau 3 | * 4 | * Permission to use, copy, modify, and/or distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | #ifndef __LIB_UTILS_AVL_CMP_H 17 | #define __LIB_UTILS_AVL_CMP_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | int avl_strcmp(const void *k1, const void *k2, void *ptr); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif /* __LIB_UTILS_AVL_CMP_H */ 30 | -------------------------------------------------------------------------------- /source/lib/utils/base64-alloc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * base64-alloc.c -- A basic base64 encode implementation 3 | * _______ _______ __ __ 4 | * / ____/ | / / ___/____ _____/ /_____ / /_ 5 | * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ 6 | * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ 7 | * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ 8 | * 9 | * 10 | * The MIT License (MIT) 11 | * Copyright (c) 2009-2016 Gerardo Orellana 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in all 21 | * copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | * SOFTWARE. 30 | */ 31 | 32 | #include 33 | #include 34 | 35 | #include "base64.h" 36 | 37 | /* Encodes the given data with base64.. 38 | * 39 | * On success, the encoded nul-terminated data, as a string is returned. */ 40 | char * 41 | b64_encode_alloc (const void *buf, size_t size) 42 | { 43 | static const char base64[] = 44 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 45 | 46 | char *str = (char *) malloc ((size + 3) * 4 / 3 + 1); 47 | 48 | char *p = str; 49 | const unsigned char *q = (const unsigned char *) buf; 50 | size_t i = 0; 51 | 52 | while (i < size) { 53 | int c = q[i++]; 54 | c *= 256; 55 | if (i < size) 56 | c += q[i]; 57 | i++; 58 | 59 | c *= 256; 60 | if (i < size) 61 | c += q[i]; 62 | i++; 63 | 64 | *p++ = base64[(c & 0x00fc0000) >> 18]; 65 | *p++ = base64[(c & 0x0003f000) >> 12]; 66 | 67 | if (i > size + 1) 68 | *p++ = '='; 69 | else 70 | *p++ = base64[(c & 0x00000fc0) >> 6]; 71 | 72 | if (i > size) 73 | *p++ = '='; 74 | else 75 | *p++ = base64[c & 0x0000003f]; 76 | } 77 | 78 | *p = 0; 79 | 80 | return str; 81 | } 82 | -------------------------------------------------------------------------------- /source/lib/utils/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * base64.h: internal interfaces for Base64. 3 | * 4 | * Copyright (C) 2020 FMSoft 5 | * 6 | * Permission to use, copy, modify, and/or distribute this software for any 7 | * purpose with or without fee is hereby granted, provided that the above 8 | * copyright notice and this permission notice appear in all copies. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | */ 18 | #ifndef __LIB_UTILS_BASE64_H 19 | #define __LIB_UTILS_BASE64_H 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | char *b64_encode_alloc (const void *buf, size_t size); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /* __LIB_UTILS_BASE64_H */ 32 | 33 | -------------------------------------------------------------------------------- /source/lib/utils/gslist.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The MIT License (MIT) 3 | * Copyright (c) 2009-2016 Gerardo Orellana 4 | * Copyright (c) 2020 FMSoft 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #ifndef __LIB_UTILS_GSLIST_H 26 | #define __LIB_UTILS_GSLIST_H 27 | 28 | /* Generic Single linked-list */ 29 | typedef struct gs_list_ 30 | { 31 | void *data; 32 | struct gs_list_ *next; 33 | } gs_list; 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* single linked-list */ 40 | gs_list *gslist_create (void *data); 41 | gs_list *gslist_find (gs_list * node, int (*func) (void *, void *), void *data); 42 | gs_list *gslist_insert_append (gs_list * node, void *data); 43 | gs_list *gslist_insert_prepend (gs_list * list, void *data); 44 | int gslist_count (gs_list * list); 45 | int gslist_foreach (gs_list * node, int (*func) (void *, void *), 46 | void *user_data); 47 | int gslist_remove_node (gs_list ** list, gs_list * node); 48 | int gslist_remove_nodes (gs_list * list); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif // __LIB_UTILS_GSLIST_H 55 | -------------------------------------------------------------------------------- /source/lib/utils/hvml-uri.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hvml-uri - utilities for HVML URI. 3 | * 4 | * Copyright (C) 2022 FMSoft 5 | * 6 | * Author: Vincent Wei 7 | * 8 | * Permission to use, copy, modify, and/or distribute this software for any 9 | * purpose with or without fee is hereby granted, provided that the above 10 | * copyright notice and this permission notice appear in all copies. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | */ 20 | 21 | #ifndef __LIB_UTILS_HVML_URI_H 22 | #define __LIB_UTILS_HVML_URI_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | size_t hvml_uri_assemble(char *uri, const char *host, const char* app, 31 | const char* runner, const char *group, const char *page); 32 | 33 | char* hvml_uri_assemble_alloc(const char* host, const char* app, 34 | const char* runner, const char *group, const char *page); 35 | 36 | bool hvml_uri_split(const char *uri, 37 | char *host, char *app, char *runner, char *group, char *page); 38 | 39 | /* 40 | * Break down an HVML URI in the following pattern: 41 | * 42 | * hvml://///[/][?key1=value1&key2=value2] 43 | * 44 | */ 45 | bool hvml_uri_split_alloc(const char *uri, 46 | char **host, char **app, char **runner, char **group, char **page); 47 | 48 | bool hvml_uri_get_query_value(const char *uri, const char *key, 49 | char *value_buff); 50 | 51 | bool hvml_uri_get_query_value_alloc(const char *uri, const char *key, 52 | char **value_buff); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __LIB_UTILS_HVML_URI_H */ 59 | -------------------------------------------------------------------------------- /source/lib/utils/kvlist.c: -------------------------------------------------------------------------------- 1 | /* 2 | * kvlist - simple key/value store 3 | * 4 | * Copyright (C) 2021 FMSoft 5 | * Copyright (C) 2014 Felix Fietkau 6 | * 7 | * Permission to use, copy, modify, and/or distribute this software for any 8 | * purpose with or without fee is hereby granted, provided that the above 9 | * copyright notice and this permission notice appear in all copies. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 | */ 19 | #include 20 | #include 21 | 22 | #include "misc.h" 23 | #include "avl-cmp.h" 24 | #include "kvlist.h" 25 | 26 | int kvlist_strlen(struct kvlist *kv, const void *data) 27 | { 28 | (void) kv; 29 | return strlen(data) + 1; 30 | } 31 | 32 | void kvlist_init(struct kvlist *kv, 33 | int (*get_len)(struct kvlist *kv, const void *data)) 34 | { 35 | avl_init(&kv->avl, avl_strcmp, false, NULL); 36 | kv->get_len = get_len; 37 | } 38 | 39 | static struct kvlist_node *__kvlist_get(struct kvlist *kv, const char *name) 40 | { 41 | struct kvlist_node *node; 42 | 43 | return avl_find_element(&kv->avl, name, node, avl); 44 | } 45 | 46 | void *kvlist_get(struct kvlist *kv, const char *name) 47 | { 48 | struct kvlist_node *node; 49 | 50 | node = __kvlist_get(kv, name); 51 | if (!node) 52 | return NULL; 53 | 54 | return node->data; 55 | } 56 | 57 | bool kvlist_delete(struct kvlist *kv, const char *name) 58 | { 59 | struct kvlist_node *node; 60 | 61 | node = __kvlist_get(kv, name); 62 | if (node) { 63 | avl_delete(&kv->avl, &node->avl); 64 | free(node); 65 | } 66 | 67 | return !!node; 68 | } 69 | 70 | const char *kvlist_set_ex(struct kvlist *kv, const char *name, const void *data) 71 | { 72 | struct kvlist_node *node; 73 | char *name_buf; 74 | int len = kv->get_len ? kv->get_len(kv, data) : (int)(sizeof (void *)); 75 | 76 | node = calloc_a(sizeof(struct kvlist_node) + len, 77 | &name_buf, strlen(name) + 1); 78 | if (!node) 79 | return NULL; 80 | 81 | kvlist_delete(kv, name); 82 | 83 | memcpy(node->data, data, len); 84 | 85 | node->avl.key = strcpy(name_buf, name); 86 | avl_insert(&kv->avl, &node->avl); 87 | 88 | return node->avl.key; 89 | } 90 | 91 | void kvlist_free(struct kvlist *kv) 92 | { 93 | struct kvlist_node *node, *tmp; 94 | 95 | avl_remove_all_elements(&kv->avl, node, avl, tmp) 96 | free(node); 97 | } 98 | 99 | bool kvlist_is_empty(struct kvlist *kv) 100 | { 101 | return avl_is_empty(&kv->avl); 102 | } 103 | 104 | unsigned int kvlist_count(struct kvlist *kv) 105 | { 106 | return avl_count(&kv->avl); 107 | } 108 | -------------------------------------------------------------------------------- /source/lib/utils/kvlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * kvlist - simple key/value store 3 | * 4 | * Copyright (C) 2021 FMSoft 5 | * Copyright (C) 2014 Felix Fietkau 6 | * 7 | * Permission to use, copy, modify, and/or distribute this software for any 8 | * purpose with or without fee is hereby granted, provided that the above 9 | * copyright notice and this permission notice appear in all copies. 10 | * 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 | */ 19 | #ifndef __LIB_UTILS_KVLIST_H 20 | #define __LIB_UTILS_KVLIST_H 21 | 22 | #include "avl-cmp.h" 23 | #include "avl.h" 24 | 25 | struct kvlist { 26 | struct avl_tree avl; 27 | 28 | /* VW: can be NULL for pointer */ 29 | int (*get_len)(struct kvlist *kv, const void *data); 30 | }; 31 | 32 | struct kvlist_node { 33 | struct avl_node avl; 34 | 35 | /* VW: use the maximum alignment instead of 4 (pointer safe)*/ 36 | char data[0] __attribute__((aligned)); 37 | }; 38 | 39 | #define KVLIST_INIT(_name, _get_len) \ 40 | { \ 41 | .avl = AVL_TREE_INIT(_name.avl, avl_strcmp, false, NULL), \ 42 | .get_len = _get_len \ 43 | } 44 | 45 | #define KVLIST(_name, _get_len) \ 46 | struct kvlist _name = KVLIST_INIT(_name, _get_len) 47 | 48 | #define __ptr_to_kv(_ptr) container_of(((char *) (_ptr)), struct kvlist_node, data[0]) 49 | #define __avl_list_to_kv(_l) container_of(_l, struct kvlist_node, avl.list) 50 | 51 | #define kvlist_for_each(kv, name, value) \ 52 | for (value = (void *) __avl_list_to_kv((kv)->avl.list_head.next)->data, \ 53 | name = (const char *) __ptr_to_kv(value)->avl.key, (void) name; \ 54 | &__ptr_to_kv(value)->avl.list != &(kv)->avl.list_head; \ 55 | value = (void *) (__avl_list_to_kv(__ptr_to_kv(value)->avl.list.next))->data, \ 56 | name = (const char *) __ptr_to_kv(value)->avl.key) 57 | 58 | #define kvlist_for_each_safe(kv, name, next, value) \ 59 | for (value = (void *) __avl_list_to_kv((kv)->avl.list_head.next)->data, \ 60 | name = (const char *) __ptr_to_kv(value)->avl.key, (void) name, \ 61 | next = (void *) (__avl_list_to_kv(__ptr_to_kv(value)->avl.list.next))->data; \ 62 | &__ptr_to_kv(value)->avl.list != &(kv)->avl.list_head; \ 63 | value = next, name = (const char *) __ptr_to_kv(value)->avl.key, \ 64 | next = (void *) (__avl_list_to_kv(__ptr_to_kv(value)->avl.list.next))->data) 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | /* get_len can be NULL for pointer */ 71 | void kvlist_init(struct kvlist *kv, 72 | int (*get_len)(struct kvlist *kv, const void *data)); 73 | void kvlist_free(struct kvlist *kv); 74 | 75 | void *kvlist_get(struct kvlist *kv, const char *name); 76 | const char *kvlist_set_ex(struct kvlist *kv, 77 | const char *name, const void *data); 78 | 79 | static inline bool 80 | kvlist_set(struct kvlist *kv, const char *name, const void *data) { 81 | return kvlist_set_ex(kv, name, data) != NULL; 82 | } 83 | 84 | bool kvlist_delete(struct kvlist *kv, const char *name); 85 | 86 | int kvlist_strlen(struct kvlist *kv, const void *data); 87 | 88 | bool kvlist_is_empty(struct kvlist *kv); 89 | 90 | unsigned int kvlist_count(struct kvlist *k); 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __LIB_UTILS_KVLIST_H */ 97 | -------------------------------------------------------------------------------- /source/lib/utils/load-asset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * load-asset - Load asset content. 3 | * 4 | * Copyright (C) 2022 FMSoft 5 | * 6 | * Author: Vincent Wei 7 | * 8 | * Permission to use, copy, modify, and/or distribute this software for any 9 | * purpose with or without fee is hereby granted, provided that the above 10 | * copyright notice and this permission notice appear in all copies. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | */ 20 | 21 | #ifndef __LIB_UTILS_LOAD_ASSET_H 22 | #define __LIB_UTILS_LOAD_ASSET_H 23 | 24 | #include 25 | #include 26 | 27 | #define ASSET_FLAG_ONCE 0x01 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | char *open_and_load_asset(const char *env, const char *prefix, 34 | const char *file, ssize_t *max_to_load, int *fd, size_t *length); 35 | 36 | char *load_asset_content(const char *env, const char *prefix, 37 | const char *file, size_t *length, unsigned flags); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* __LIB_UTILS_LOAD_ASSET_H */ 44 | -------------------------------------------------------------------------------- /source/lib/utils/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sha1 - Implementation of SHA1 hash function. 3 | * 4 | * From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c 5 | * 6 | * Modify the source code with Unix C style by Vincent Wei 7 | * - Nov. 2020 8 | * 9 | * Copyright (C) 2020 FMSoft 10 | * 11 | * Permission to use, copy, modify, and/or distribute this software for any 12 | * purpose with or without fee is hereby granted, provided that the above 13 | * copyright notice and this permission notice appear in all copies. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 16 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 17 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 18 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 20 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 21 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 22 | * 23 | */ 24 | 25 | #ifndef __LIB_UTILS_SHA1_H 26 | #define __LIB_UTILS_SHA1_H 27 | 28 | #include 29 | #include 30 | 31 | typedef struct { 32 | uint32_t state[5]; 33 | uint32_t count[2]; 34 | uint8_t buffer[64]; 35 | } Sha1Context; 36 | 37 | #define SHA1_DIGEST_SIZE (20) 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | void sha1_init (Sha1Context *context); 44 | void sha1_update (Sha1Context *context, uint8_t *data, uint32_t len); 45 | void sha1_finalize (Sha1Context *context, uint8_t *digest); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __LIB_UTILS_SHA1_H */ 52 | 53 | -------------------------------------------------------------------------------- /source/lib/utils/sorted-array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sorted_array - simple sorted array 3 | * 4 | * Copyright (C) 2021 FMSoft 5 | * 6 | * Author: Vincent Wei 7 | * 8 | * Permission to use, copy, modify, and/or distribute this software for any 9 | * purpose with or without fee is hereby granted, provided that the above 10 | * copyright notice and this permission notice appear in all copies. 11 | * 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 | */ 20 | #ifndef __LIB_UTILS_SORTED_ARRAY_H 21 | #define __LIB_UTILS_SORTED_ARRAY_H 22 | 23 | #include 24 | #include 25 | 26 | struct sorted_array; 27 | 28 | typedef void (*sacb_free)(uint64_t sortv, void *data); 29 | typedef int (*sacb_compare)(uint64_t sortv1, uint64_t sortv2); 30 | 31 | #define SAFLAG_ORDER_ASC 0x0000 32 | #define SAFLAG_ORDER_DESC 0x0001 33 | #define SAFLAG_DUPLCATE_SORTV 0x0002 34 | 35 | #define SAFLAG_DEFAULT 0x0000 36 | 37 | #define PTR2U64(p) ((uint64_t)(uintptr_t)(p)) 38 | #define INT2PTR(i) ((void *)(uintptr_t)(i)) 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* create an empty sorted array; free_fn can be NULL */ 45 | struct sorted_array * 46 | sorted_array_create(unsigned int flags, size_t sz_init, 47 | sacb_free free_fn, sacb_compare cmp_fn); 48 | 49 | /* destroy a sorted array */ 50 | void sorted_array_destroy(struct sorted_array *sa); 51 | 52 | /* add a new member with the sort value and the data. */ 53 | int sorted_array_add(struct sorted_array *sa, uint64_t sortv, void *data); 54 | 55 | /* remove one member which has the same sort value. */ 56 | bool sorted_array_remove(struct sorted_array *sa, uint64_t sortv); 57 | 58 | /* find the first member which has the same sort value. */ 59 | bool sorted_array_find(struct sorted_array *sa, uint64_t sortv, void **data); 60 | 61 | /* retrieve the number of the members of the sorted array */ 62 | size_t sorted_array_count(struct sorted_array *sa); 63 | 64 | /* retrieve the member by the index and return the sort value; 65 | data can be NULL. */ 66 | uint64_t sorted_array_get(struct sorted_array *sa, size_t idx, void **data); 67 | 68 | /* delete the member by the index */ 69 | void sorted_array_delete(struct sorted_array *sa, size_t idx); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* __LIB_UTILS_SORTED_ARRAY_H */ 76 | -------------------------------------------------------------------------------- /source/tools/aur/README.md: -------------------------------------------------------------------------------- 1 | # xGUI-Pro AUR package packaging script 2 | 3 | ## xGUI-Pro release version Packaging script 4 | 5 | ```bash 6 | # The following operations are done under the Arch Linux release version. 7 | # Other Linux distributions can be referenced. 8 | $ cd aur/xguipro 9 | 10 | # Modify the version number to the current latest release number 11 | $ vim PKGBUILD 12 | # eg., pkgver=0.8.1 13 | # Save and exit 14 | 15 | # Update the check value of the xGUI-Pro release version and generate a .SRCINFO file 16 | $ updpkgsums && makepkg --printsrcinfo > .SRCINFO 17 | 18 | # Compile and package the xGUI-Pro release version 19 | $ makepkg -sf 20 | 21 | # Install the xGUI-Pro package 22 | $ yay -U xguipro-gtk3*.tar.zst 23 | 24 | # or 25 | $ yay -U xguipro-gtk4*.tar.zst 26 | 27 | # Compile, package and install 28 | $ makepkg -sfi 29 | 30 | # Online installation via AUR: [xguipro](https://aur.archlinux.org/pkgbase/xguipro) or [Self-built software source](https://github.com/taotieren/aur-repo) 31 | $ yay -S xguipro-gtk3 32 | 33 | # or 34 | $ yay -S xguipro-gtk4 35 | ``` 36 | 37 | ## xGUI-Pro development version Packaging script 38 | 39 | ```bash 40 | # The following operations are done under the Arch Linux release version. 41 | # Other Linux distributions can be referenced. 42 | $ cd aur/xguipro-git 43 | 44 | # The xGUI-Pro development version does not need to update the check values and .SRCINFO files when compiling. 45 | # Updates are required only when submitted to AUR. 46 | # Update the check value of the xGUI-Pro development version and generate a .SRCINFO file 47 | $ updpkgsums && makepkg --printsrcinfo > .SRCINFO 48 | 49 | # Compile and package the xGUI-Pro development version 50 | $ makepkg -sf 51 | 52 | # Install the xGUI-Pro package 53 | $ yay -U xguipro-gtk3-git-*.tar.zst 54 | 55 | # or 56 | $ yay -U xguipro-gtk4-git-*.tar.zst 57 | 58 | # Compile, package and install 59 | $ makepkg -sfi 60 | 61 | # Online installation via AUR: [xguipro-git](https://aur.archlinux.org/pkgbase/xguipro-git) or [Self-built software source](https://github.com/taotieren/aur-repo) 62 | $ yay -S xguipro-gtk3-git 63 | 64 | # or 65 | $ yay -S xguipro-gtk4-git 66 | ``` 67 | -------------------------------------------------------------------------------- /source/tools/debian/changelog: -------------------------------------------------------------------------------- 1 | hvml-xgui-pro (0.0.1-1) unstable; urgency=medium 2 | 3 | * initial release 4 | 5 | -- lichenggang Tue, 23 Mar 2021 08:49:57 +0100 6 | -------------------------------------------------------------------------------- /source/tools/debian/control: -------------------------------------------------------------------------------- 1 | Source: hvml-xgui-pro 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Vincent Wei 5 | Build-Depends: debhelper-compat (= 13), cmake, libwebkit2gtk-hvml-4.0-dev, libsoup2.4-dev, libssl-dev, libgtk-3-dev, hvml-dom-ruler, hvml-purc-bin, libhvml-purc-dev, libxml2, ninja-build, libcurl4-openssl-dev, libkf5kjs-dev 6 | Standards-Version: 4.5.1 7 | Rules-Requires-Root: no 8 | Homepage: https://github.com/HVML/PurC 9 | 10 | Package: hvml-xgui-pro 11 | Architecture: any 12 | Depends: ${misc:Depends}, ${shlibs:Depends} 13 | Description: xGUI Pro is a modern, cross-platform, and advanced HVML renderer which is based on tailored WebKit. 14 | -------------------------------------------------------------------------------- /source/tools/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: xGUI-Pro 3 | Source: https://github.com/HVML/xGUI-Pro 4 | 5 | Files: * 6 | Copyright: 2021, 2022 FMSoft Technologies 7 | License: GPL-3+ 8 | 9 | License: GPL-3+ 10 | This program is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License along 21 | with this program; if not, write to the Free Software Foundation, Inc., 22 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23 | . 24 | On Debian systems, the full text of the GNU General Public 25 | License version 3 can be found in the file 26 | '/usr/share/common-licenses/GPL-3'. 27 | 28 | License: LGPL-2.1 29 | On Debian systems, the full text of the GNU Library Public License 2.1 30 | can be found in the file '/usr/share/common-licenses/LGPL-2.1'. 31 | -------------------------------------------------------------------------------- /source/tools/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | 5 | override_dh_auto_configure: 6 | cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DPORT=GTK -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_LIBEXECDIR=lib -B . 7 | 8 | override_dh_auto_build: 9 | cmake --build . 10 | override_dh_dwz: 11 | #override_dh_installdocs: 12 | # Do not install a copyright file 13 | # no /usr/share/docs/* needed! 14 | #dh_installdocs --exclude=debian/copyright 15 | # Do not install changelogs for space conservation 16 | #override_dh_installchangelogs: 17 | -------------------------------------------------------------------------------- /source/tools/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /source/wtf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_property(DIRECTORY . PROPERTY FOLDER "wtf") 2 | 3 | include(GlobalCommon) 4 | include(MyMacros.cmake) 5 | 6 | CHECK_THREAD_LOCAL_STORAGE_KEYWORD() 7 | configure_file(wtf/TLSKeyword.h.in ${WTF_FRAMEWORK_HEADERS_DIR}/wtf/TLSKeyword.h) 8 | 9 | add_subdirectory(wtf) 10 | -------------------------------------------------------------------------------- /source/wtf/MyMacros.cmake: -------------------------------------------------------------------------------- 1 | # Append the all C files in the specified directory list to the source list 2 | MACRO(CHECK_THREAD_LOCAL_STORAGE_KEYWORD) 3 | set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) 4 | set(WTF_TLS_KEYWORD_TYPE "TLS_KEYWORD_TYPE_NONE") 5 | file(WRITE "${CMAKE_BINARY_DIR}/check_tls_storage_class.c" 6 | " 7 | #if defined(__MINGW32__) && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) 8 | #error This MinGW version has broken __thread support 9 | #endif 10 | #ifdef __OpenBSD__ 11 | #error OpenBSD has broken __thread support 12 | #endif 13 | __thread int test; 14 | int main (void) { return 0; } 15 | ") 16 | try_compile(_TLS_STORAGE_CLASS 17 | "${CMAKE_BINARY_DIR}/check_tls_storage_class" 18 | "${CMAKE_BINARY_DIR}/check_tls_storage_class.c" 19 | OUTPUT_VARIABLE __output) 20 | if (NOT _TLS_STORAGE_CLASS) 21 | message(STATUS "Compile check_tls_storage_class.c: ${__output}") 22 | file(WRITE "${CMAKE_BINARY_DIR}/check_tls_declaration_specifier.c" 23 | " 24 | int __declspec(thread) test; 25 | int main (void) { return 0; } 26 | ") 27 | try_compile(_TLS_DECL_SPEC 28 | "${CMAKE_BINARY_DIR}/check_tls_declaration_specifier" 29 | "${CMAKE_BINARY_DIR}/check_tls_declaration_specifier.c" 30 | OUTPUT_VARIABLE __output) 31 | if (_TLS_DECL_SPEC) 32 | set(WTF_TLS_KEYWORD_TYPE "TLS_KEYWORD_TYPE_DECL_SPEC") 33 | else () 34 | message(STATUS "compile check_tls_declaration_specifier.c: ${__output}") 35 | endif () 36 | unset(_TLS_DECL_SPEC) 37 | else () 38 | set(WTF_TLS_KEYWORD_TYPE "TLS_KEYWORD_TYPE_STORAGE_CLASS") 39 | endif () 40 | unset(_TLS_STORAGE_CLASS) 41 | unset (__output) 42 | ENDMACRO() 43 | -------------------------------------------------------------------------------- /source/wtf/wtf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(WTF_PUBLIC_HEADERS 2 | Compiler.h 3 | ExportMacros.h 4 | Platform.h 5 | PlatformCallingConventions.h 6 | PlatformCPU.h 7 | PlatformEnable.h 8 | PlatformHave.h 9 | PlatformLegacy.h 10 | PlatformOS.h 11 | PlatformUse.h 12 | ) 13 | 14 | set(WTF_SOURCES 15 | nothing.c 16 | ) 17 | 18 | set(WTF_PRIVATE_INCLUDE_DIRECTORIES 19 | "${CMAKE_BINARY_DIR}" 20 | "${WTF_DERIVED_SOURCES_DIR}" 21 | "${WTF_DIR}" 22 | "${WTF_DIR}/wtf" 23 | ) 24 | 25 | set(WTF_LIBRARIES 26 | ${CMAKE_DL_LIBS} 27 | ) 28 | 29 | #if (NOT USE_SYSTEM_MALLOC) 30 | # list(APPEND WTF_LIBRARIES xGUIPro::bmalloc) 31 | #endif () 32 | 33 | set(WTF_INTERFACE_LIBRARIES WTF) 34 | set(WTF_INTERFACE_INCLUDE_DIRECTORIES ${WTF_FRAMEWORK_HEADERS_DIR}) 35 | set(WTF_INTERFACE_DEPENDENCIES WTF_CopyHeaders) 36 | 37 | XGUIPRO_FRAMEWORK_DECLARE(WTF) 38 | XGUIPRO_INCLUDE_CONFIG_FILES_IF_EXISTS() 39 | 40 | XGUIPRO_COPY_FILES(WTF_CopyHeaders 41 | DESTINATION ${WTF_FRAMEWORK_HEADERS_DIR}/wtf 42 | FILES ${WTF_PUBLIC_HEADERS} 43 | ) 44 | 45 | XGUIPRO_WRAP_SOURCELIST(${WTF_SOURCES}) 46 | XGUIPRO_FRAMEWORK(WTF) 47 | XGUIPRO_FRAMEWORK_TARGET(WTF) 48 | 49 | if (MSVC) 50 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS") 51 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS") 52 | endif () 53 | 54 | -------------------------------------------------------------------------------- /source/wtf/wtf/ExportMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Apple Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * This file handles shared library symbol export decorations. It is recommended 26 | * that all xGUI projects use these definitions so that symbol exports work 27 | * properly on all platforms and compilers that xGUI builds under. 28 | */ 29 | 30 | #pragma once 31 | 32 | #include 33 | 34 | // Different platforms have different defaults for symbol visibility. Usually 35 | // the compiler and the linker just take care of it. However for references to 36 | // runtime routines from JIT stubs, it matters to be able to declare a symbol as 37 | // being local to the target being generated, and thus not subject to (e.g.) ELF 38 | // symbol interposition rules. 39 | 40 | #if USE(DECLSPEC_ATTRIBUTE) 41 | #define HAVE_INTERNAL_VISIBILITY 1 42 | #define WTF_INTERNAL 43 | #elif USE(VISIBILITY_ATTRIBUTE) 44 | #define HAVE_INTERNAL_VISIBILITY 1 45 | #define WTF_INTERNAL __attribute__((visibility("hidden"))) 46 | #else 47 | #define WTF_INTERNAL 48 | #endif 49 | 50 | #if USE(DECLSPEC_ATTRIBUTE) 51 | #define WTF_EXPORT_DECLARATION __declspec(dllexport) 52 | #define WTF_IMPORT_DECLARATION __declspec(dllimport) 53 | #elif USE(VISIBILITY_ATTRIBUTE) 54 | #define WTF_EXPORT_DECLARATION __attribute__((visibility("default"))) 55 | #define WTF_IMPORT_DECLARATION WTF_EXPORT_DECLARATION 56 | #else 57 | #define WTF_EXPORT_DECLARATION 58 | #define WTF_IMPORT_DECLARATION 59 | #endif 60 | 61 | #if !defined(WTF_EXPORT_PRIVATE) 62 | 63 | #if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) 64 | #define WTF_EXPORT_PRIVATE WTF_EXPORT_DECLARATION 65 | #else 66 | #define WTF_EXPORT_PRIVATE WTF_IMPORT_DECLARATION 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /source/wtf/wtf/PlatformCallingConventions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2020 Apple Inc. All rights reserved. 3 | * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 | * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 19 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #pragma once 29 | 30 | #ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION 31 | #error "Please #include instead of this file directly." 32 | #endif 33 | 34 | /* Macros for specifing specific calling conventions. */ 35 | 36 | 37 | #if CPU(X86) && COMPILER(MSVC) 38 | #define JSC_HOST_CALL __fastcall 39 | #elif CPU(X86) && COMPILER(GCC_COMPATIBLE) 40 | #define JSC_HOST_CALL __attribute__ ((fastcall)) 41 | #else 42 | #define JSC_HOST_CALL 43 | #endif 44 | 45 | #if CPU(X86) && OS(WINDOWS) 46 | #define CALLING_CONVENTION_IS_STDCALL 1 47 | #ifndef CDECL 48 | #if COMPILER(MSVC) 49 | #define CDECL __cdecl 50 | #else 51 | #define CDECL __attribute__ ((__cdecl)) 52 | #endif 53 | #endif 54 | #else 55 | #define CALLING_CONVENTION_IS_STDCALL 0 56 | #endif 57 | 58 | #if CPU(X86) 59 | #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1 60 | #ifndef FASTCALL 61 | #if COMPILER(MSVC) 62 | #define FASTCALL __fastcall 63 | #else 64 | #define FASTCALL __attribute__ ((fastcall)) 65 | #endif 66 | #endif 67 | #else 68 | #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0 69 | #endif 70 | 71 | #if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL 72 | #define JIT_OPERATION CDECL 73 | #else 74 | #define JIT_OPERATION 75 | #endif 76 | -------------------------------------------------------------------------------- /source/wtf/wtf/PlatformEnable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2020 Apple Inc. All rights reserved. 3 | * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 | * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. 5 | * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 | * Copyright (C) 2020 Beijing FMSoft Technologies Co., Ltd. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 25 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #pragma once 31 | 32 | #ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION 33 | #error "Please #include instead of this file directly." 34 | #endif 35 | 36 | 37 | #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) 38 | 39 | /* Use this file to list _all_ ENABLE() macros. Define the macros to be one of the following values: 40 | * - "0" disables the feature by default. The feature can still be enabled for a specific port or environment. 41 | * - "1" enables the feature by default. The feature can still be disabled for a specific port or environment. 42 | * 43 | * The feature defaults in this file are only taken into account if the (port specific) build system 44 | * has not enabled or disabled a particular feature. 45 | * 46 | * Use this file to define ENABLE() macros only. Do not use this file to define USE() or macros ! 47 | * 48 | * Only define a macro if it was not defined before - always check for !defined first. 49 | * 50 | * Keep the file sorted by the name of the defines. As an exception you can change the order 51 | * to allow interdependencies between the default values. 52 | * 53 | * Below are a few potential commands to take advantage of this file running from the Source/WTF directory 54 | * 55 | * Get the list of feature defines: grep -o "ENABLE_\(\w\+\)" wtf/PlatformEnable.h | sort | uniq 56 | * Get the list of features enabled by default for a PLATFORM(XXX): gcc -E -dM -I. -DWTF_PLATFORM_XXX "wtf/Platform.h" | grep "ENABLE_\w\+ 1" | cut -d' ' -f2 | sort 57 | */ 58 | 59 | 60 | /* ENABLE_ASSERTS should be true if we want the current compilation unit to 61 | do debug assertion checks unconditionally (e.g. treat a debug ASSERT 62 | like a RELEASE_ASSERT. 63 | */ 64 | #ifndef ENABLE_ASSERTS 65 | #ifdef NDEBUG 66 | #define ENABLE_ASSERTS 0 67 | #else 68 | #define ENABLE_ASSERTS 1 69 | #endif 70 | #endif 71 | 72 | /* --------- ENABLE macro defaults --------- */ 73 | 74 | /* Do not use PLATFORM() tests in this section ! */ 75 | 76 | -------------------------------------------------------------------------------- /source/wtf/wtf/PlatformLegacy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 | * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 | * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. 5 | * Copyright (C) 2020 Beijing FMSoft Technologies Co., Ltd. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION 32 | #error "Please #include instead of this file directly." 33 | #endif 34 | 35 | 36 | /* PLATFORM() - handles OS, operating environment, graphics API, and 37 | CPU. This macro will be phased out in favor of platform adaptation 38 | macros, policy decision macros, and top-level port definitions. */ 39 | #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) 40 | 41 | 42 | /* FIXME: these are all mixes of OS, operating environment and policy choices. */ 43 | /* PLATFORM(GTK) */ 44 | /* PLATFORM(MAC) */ 45 | /* PLATFORM(IOS) */ 46 | /* PLATFORM(IOS_FAMILY) */ 47 | /* PLATFORM(IOS_SIMULATOR) */ 48 | /* PLATFORM(IOS_FAMILY_SIMULATOR) */ 49 | /* PLATFORM(WIN) */ 50 | #if defined(BUILDING_GTK__) 51 | #define WTF_PLATFORM_GTK 1 52 | #elif defined(BUILDING_HBD__) 53 | #define WTF_PLATFORM_HBD 1 54 | #elif defined(BUILDING_MINIGUI__) 55 | #define WTF_PLATFORM_MINIGUI 1 56 | #elif defined(BUILDING_WPE__) 57 | #define WTF_PLATFORM_WPE 1 58 | #elif defined(BUILDING_JSCONLY__) 59 | /* JSCOnly does not provide PLATFORM() macro */ 60 | #elif OS(MAC_OS_X) 61 | #define WTF_PLATFORM_MAC 1 62 | #elif OS(IOS_FAMILY) 63 | #if OS(IOS) 64 | /* PLATFORM(IOS) - iOS and iPadOS only (iPhone and iPad), not including macCatalyst, not including watchOS, not including tvOS */ 65 | #define WTF_PLATFORM_IOS 1 66 | #endif 67 | /* PLATFORM(IOS_FAMILY) - iOS family, including iOS, iPadOS, macCatalyst, tvOS, watchOS */ 68 | #define WTF_PLATFORM_IOS_FAMILY 1 69 | #if TARGET_OS_SIMULATOR 70 | #if OS(IOS) 71 | #define WTF_PLATFORM_IOS_SIMULATOR 1 72 | #endif 73 | #define WTF_PLATFORM_IOS_FAMILY_SIMULATOR 1 74 | #endif 75 | #if defined(TARGET_OS_MACCATALYST) && TARGET_OS_MACCATALYST 76 | #define WTF_PLATFORM_MACCATALYST 1 77 | #endif 78 | #elif OS(WINDOWS) 79 | #define WTF_PLATFORM_WIN 1 80 | #endif 81 | 82 | /* PLATFORM(COCOA) */ 83 | #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) 84 | #define WTF_PLATFORM_COCOA 1 85 | #endif 86 | 87 | /* PLATFORM(APPLETV) */ 88 | #if defined(TARGET_OS_TV) && TARGET_OS_TV 89 | #define WTF_PLATFORM_APPLETV 1 90 | #endif 91 | 92 | /* PLATFORM(WATCHOS) */ 93 | #if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH 94 | #define WTF_PLATFORM_WATCHOS 1 95 | #endif 96 | -------------------------------------------------------------------------------- /source/wtf/wtf/TLSKeyword.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 FMSoft. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * This file handles shared library symbol export decorations. It is recommended 26 | * that all PurC projects use these definitions so that symbol exports work 27 | * properly on all platforms and compilers that PurC builds under. 28 | */ 29 | 30 | #pragma once 31 | 32 | #define TLS_KEYWORD_TYPE_NONE 0 33 | #define TLS_KEYWORD_TYPE_STORAGE_CLASS 1 34 | #define TLS_KEYWORD_TYPE_DECL_SPEC 2 35 | 36 | #define HAVE_TLS_KEYWORD @WTF_TLS_KEYWORD_TYPE@ 37 | -------------------------------------------------------------------------------- /source/wtf/wtf/nothing.c: -------------------------------------------------------------------------------- 1 | // nothing 2 | --------------------------------------------------------------------------------