aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/modules/FindWaylandProtocolsWebOS.cmake27
-rw-r--r--cmake/platform/linux/webos.cmake10
-rw-r--r--cmake/scripts/linux/ArchSetup.cmake2
-rw-r--r--cmake/scripts/linux/ExtraTargets.cmake10
-rw-r--r--docs/README.md1
-rw-r--r--docs/README.webOS.md340
-rw-r--r--docs/resources/webos.svg99
-rw-r--r--tools/depends/README.md3
-rw-r--r--tools/depends/configure.ac23
-rw-r--r--tools/depends/target/Makefile11
-rw-r--r--tools/depends/target/webos-wayland-extensions/Makefile33
-rw-r--r--tools/depends/target/webos-wayland-extensions/WEBOS-WAYLAND-EXTENSIONS-VERSION4
-rw-r--r--tools/webOS/packaging/Makefile129
-rw-r--r--tools/webOS/packaging/appinfo.json.in12
-rwxr-xr-xtools/webOS/packaging/icon.pngbin0 -> 1799 bytes
-rw-r--r--tools/webOS/packaging/keyboard.xml7
-rwxr-xr-xtools/webOS/packaging/kodi.sh.in16
-rw-r--r--tools/webOS/packaging/largeIcon.pngbin0 -> 2956 bytes
-rw-r--r--xbmc/windowing/wayland/CMakeLists.txt9
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceWebOSShell.cpp125
-rw-r--r--xbmc/windowing/wayland/ShellSurfaceWebOSShell.h70
-rw-r--r--xbmc/windowing/wayland/WinSystemWayland.cpp9
22 files changed, 934 insertions, 6 deletions
diff --git a/cmake/modules/FindWaylandProtocolsWebOS.cmake b/cmake/modules/FindWaylandProtocolsWebOS.cmake
new file mode 100644
index 0000000000..34ec5b4ec7
--- /dev/null
+++ b/cmake/modules/FindWaylandProtocolsWebOS.cmake
@@ -0,0 +1,27 @@
+# FindWaylandProtocolsWebOS
+# -------------------------
+# Find wayland-protocol-webOS
+#
+# This will define the following variables::
+#
+# WAYLANDPROTOCOLSWEBOS_FOUND - systm has wayland-webos-client
+# WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR - directory containing the additional webOS Wayland protocols
+# from the webos-wayland-extensions package
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_WAYLAND_WEBOS_CLIENT wayland-webos-client>=1.0.0)
+endif()
+
+find_path(WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR NAMES wayland-webos/webos-shell.xml
+ PATHS ${DEPENDS_PATH}/share)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(WaylandProtocolsWebOS
+ REQUIRED_VARS WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR
+ VERSION_VAR WAYLAND_WEBOS_SERVER_VERSION)
+
+if(WAYLANDPROTOCOLSWEBOS_FOUND)
+ # Promote to cache variables so all code can access it
+ set(WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR "${WAYLAND_PROTOCOLS_WEBOS_PROTOCOLDIR}/wayland-webos" CACHE INTERNAL "")
+endif()
+
+mark_as_advanced(WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR)
diff --git a/cmake/platform/linux/webos.cmake b/cmake/platform/linux/webos.cmake
new file mode 100644
index 0000000000..d065dea2dd
--- /dev/null
+++ b/cmake/platform/linux/webos.cmake
@@ -0,0 +1,10 @@
+include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/wayland.cmake)
+
+# add wayland as platform, as we require it.
+# saves reworking other assumptions for linux windowing as the platform name.
+list(APPEND CORE_PLATFORM_NAME_LC wayland)
+
+list(APPEND PLATFORM_REQUIRED_DEPS WaylandProtocolsWebOS)
+list(APPEND PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-webos-protocols)
+list(APPEND ARCH_DEFINES -DTARGET_WEBOS)
+set(TARGET_WEBOS TRUE)
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake
index 5fbed4d74c..ab142177c8 100644
--- a/cmake/scripts/linux/ArchSetup.cmake
+++ b/cmake/scripts/linux/ArchSetup.cmake
@@ -4,7 +4,7 @@ include(cmake/scripts/linux/Linkers.txt)
set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp)
# we always want to use GNU features if available, so set _GNU_SOURCE
-set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE)
+list(APPEND ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE)
set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64)
set(PLATFORM_DIR platform/linux)
set(PLATFORMDEFS_DIR platform/posix)
diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake
index 4f5078b427..bd88775774 100644
--- a/cmake/scripts/linux/ExtraTargets.cmake
+++ b/cmake/scripts/linux/ExtraTargets.cmake
@@ -22,11 +22,21 @@ if("wayland" IN_LIST CORE_PLATFORM_NAME_LC)
"${WAYLANDPP_PROTOCOLS_DIR}/xdg-shell.xml"
"${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml"
"${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml")
+
add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp"
COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp"
DEPENDS "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS}
COMMENT "Generating wayland-protocols C++ wrappers")
+ if(TARGET_WEBOS)
+ set(WEBOS_PROTOCOL_XMLS "${WAYLANDPROTOCOLSWEBOS_PROTOCOLSDIR}/webos-shell.xml")
+ add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.cpp"
+ COMMAND "${WAYLANDPP_SCANNER}" ${WEBOS_PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.cpp"
+ DEPENDS "${WAYLANDPP_SCANNER}" ${WEBOS_PROTOCOL_XMLS}
+ COMMENT "Generating wayland-webos C++ wrappers")
+ add_custom_target(generate-wayland-webos-protocols DEPENDS wayland-webos-protocols.hpp)
+ endif()
+
# Dummy target for dependencies
add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp)
endif()
diff --git a/docs/README.md b/docs/README.md
index 836f1c39a8..acfab03009 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -18,6 +18,7 @@ Kodi uses CMake as its building system but instructions are highly dependent on
<a href="README.openSUSE.md" title="openSUSE"><img src="resources/opensuse.svg" height="78"></a>
<a href="README.tvOS.md" title="tvOS"><img src="resources/tvos.svg" height="78"></a>
<a href="README.Ubuntu.md" title="Ubuntu"><img src="resources/ubuntu.svg" height="78"></a>
+ <a href="README.webOS.md" title="webOS"><img src="resources/webos.svg" height="78"></a>
<a href="README.Windows.md" title="Windows"><img src="resources/windows.svg" height="78"></a>
</p>
diff --git a/docs/README.webOS.md b/docs/README.webOS.md
new file mode 100644
index 0000000000..519a2b00ae
--- /dev/null
+++ b/docs/README.webOS.md
@@ -0,0 +1,340 @@
+![Kodi Logo](resources/banner_slim.png)
+
+# webOS build guide
+This guide has been tested with an adapted buildroot configuration where the Linux Kernel was changed to 5.4.96 and glibc was set to 2.31, this was done so to match the same configuration found on webOS 7 devices. Instructions for doing so is included in this guide. The host OS used for compilation was Ubuntu 22.10 (64-bit). Other combinations may work but we provide no assurances that other combinations will build correctly and run identically to Team Kodi releases. Kodi will build and run on webOS 5+ (LG 2020 models) using **[Kodi's unified depends build system](../tools/depends/README.md)**. Please read it in full before you proceed to familiarize yourself with the build procedure. Note that you do not need to "root" your TV to install Kodi.
+
+## Table of Contents
+1. **[Document conventions](#1-document-conventions)**
+2. **[Prerequisites](#2-prerequisites)**
+3. **[Configure the tool chain](#3-Configure-the-tool-chain)**
+4. **[Configure ares-cli tools](#4-Configure-ares-cli-tools)**
+5. **[Get the source code](#5-get-the-source-code)**
+ 5.1. **[5.1. Downgrade flatc binary](#51-Downgrade-flatc-binary)**
+6. **[Configure and build tools and dependencies](#6-configure-and-build-tools-and-dependencies)**
+ 6.1. **[Advanced Configure Options](#61-Advanced-Configure-Options)**
+7. **[Generate Kodi Build files](#7-Generate-Kodi-Build-files)**
+ 7.1. **[Generate Project Files](#71-Generate-Project-Files)**
+ 7.2. **[Add Binary Addons to Project](#72-Add-Binary-Addons-to-Project)**
+8. **[Build](#8-build)**
+ 8.1. **[Build kodi binary](#81-Build-kodi-binary)**
+9. **[Packaging kodi to distribute as an IPK](#9-Packaging-kodi-to-distribute-as-an-IPK)**
+ 9.1. **[Create the IPK](#91-Create-the-IPK)**
+10. **[Install](#10-Install)**
+ 10.1. **[Using make install](#101-Using-make-install)**
+ 10.2. **[Using ares-cli to install](#102-Using-ares-cli-to-install)**
+11. **[Debugging ](#11-Debugging)**
+12. **[Uninstall](#12-Uninstall)**
+ 12.1. **[Using make to uninstall](#121-Using-make-to-uninstall)**
+ 12.1. **[Using ares-cli to uninstall](#122-Using-ares-cli-to-uninstall)**
+
+## 1. Document conventions
+This guide assumes you are using `terminal`, also known as `console`, `command-line` or simply `cli`. Commands need to be run at the terminal, one at a time and in the provided order.
+
+This is a comment that provides context:
+```
+this is a command
+this is another command
+and yet another one
+```
+
+**Example:** Clone Kodi's current master branch:
+```
+git clone https://github.com/xbmc/xbmc kodi
+```
+
+Commands that contain strings enclosed in angle brackets denote something you need to change to suit your needs.
+```
+git clone -b <branch-name> https://github.com/xbmc/xbmc kodi
+```
+
+**Example:** Clone Kodi's current Krypton branch:
+```
+git clone -b Krypton https://github.com/xbmc/xbmc kodi
+```
+
+Several different strategies are used to draw your attention to certain pieces of information. In order of how critical the information is, these items are marked as a note, tip, or warning. For example:
+
+**NOTE:** Linux is user friendly... It's just very particular about who its friends are.
+**TIP:** Algorithm is what developers call code they do not want to explain.
+**WARNING:** Developers don't change light bulbs. It's a hardware problem.
+
+**[back to top](#table-of-contents)** | **[back to section top](#1-document-conventions)**
+
+## 2. Prerequisites
+* **[LG developer account](https://webostv.developer.lge.com/develop/getting-started/preparing-lg-account)**. This is required to access developer mode on the webOS device.
+* **[Actvate developer mode on your webOS device]**. Follow the instructions as per **[Installing Developer Mode app page](https://webostv.developer.lge.com/develop/getting-started/developer-mode-app#installing-developer-mode-app)**.
+* **[Download ares CLI tools](https://webostv.developer.lge.com/develop/tools/cli-installation)**. These are required to package the kodi binary into a IPK format that webOS understands.
+* **[Download and setup a compatible toolchain to compile kodi]**. The toolchain which was used in this guide is **[buildroot-nc4](https://github.com/openlgtv/buildroot-nc4)**, it is an up to date buildroot configuration and comes with newer tools such as GCC 12.2.0. Other toolchains exist, such as those found on the LG OpenSource website: **https://opensource.lge.com/**. You will need to enter the model number of your TV to find the applicable toolchain.
+
+* Device with **webOS 5.0 or newer**.
+
+Team Kodi CI infrastructure is limited, and therefore we only have the single combination tested. Newer webOS versions may work, however the team does not actively test/use these versions, so use with caution. Earlier versions may work, however we dont actively support them, so use with caution.
+
+**[back to top](#table-of-contents)**
+
+## 3. Configure the tool chain
+
+```
+mkdir $HOME/kodi-dev
+tar xzvf arm-webos-linux-gnueabi_sdk-buildroot.tar.gz -C $HOME/kodi-dev
+```
+
+## 4. Configure ares-cli tools
+
+You need to add your webOS device so that it can be used later on in this guide. This step is only required once:
+
+```
+ares-setup-device -s
+```
+
+Note that the username is prisoner and the password is blank.
+
+You will need to note the name of your device for later e.g. [LG]_webOS_TV_OLED65C24LA
+
+## 5. Get the source code
+Change to your `home` directory:
+```
+cd $HOME
+```
+
+Clone Kodi's current master branch:
+```
+git clone https://github.com/xbmc/xbmc kodi
+```
+
+### 5.1. Downgrade flatc binary
+
+The version of FlatBuffers in Kodi is currently locked to v2.0.0, the flatc binary installed onto your Linux system is likely
+to be much newer and therefore incompatible. You can get a version compatible here:
+
+```
+https://github.com/google/flatbuffers/releases/download/v2.0.0/Linux.flatc.binary.clang++-9.zip
+```
+
+Place flatc somewhere in your path, for example `/usr/local/bin`
+
+Alternatively, you may run `make -C native/flatc` when in $HOME/kodi/tools/depends which will compile it for you.
+
+**[back to top](#table-of-contents)**
+
+## 6. Configure and build tools and dependencies
+Kodi should be built as a 32bit program for webOS. The dependencies are built in `$HOME/kodi/tools/depends` and installed into `/media/developer/apps/usr/palm/applications/org.xbmc.kodi/xbmc-deps`.
+**NOTE:** `--with-platform` is mandatory for all webOS platforms
+
+--prefix should be set to where xbmc-deps are going to be built
+--with-toolchain=/path/to/buildroot, --host=arm-linux or whatever your compiler is
+
+Configure build:
+```
+cd $HOME/kodi/tools/depends
+./bootstrap
+./configure --prefix=$HOME/kodi-deps --host=arm-webos-linux-gnueabi \
+ --with-toolchain=$HOME/kodi-dev/arm-webos-linux-gnueabi_sdk-buildroot \
+ --enable-debug=no \
+```
+
+Build tools and dependencies:
+```
+make -j$(getconf _NPROCESSORS_ONLN)
+```
+
+**TIP:** By adding `-j<number>` to the make command, you can choose how many concurrent jobs will be used and expedite the build process. It is recommended to use `-j$(getconf _NPROCESSORS_ONLN)` to compile on all available processor cores. The build machine can also be configured to do this automatically by adding `export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"` to your shell config (e.g. `~/.bashrc`).
+
+**WARNING:** Look for the `Dependencies built successfully.` success message. If in doubt run a single threaded `make` command until the message appears. If the single make fails, clean the specific library by issuing `make -C target/<name_of_failed_lib> distclean` and run `make`again.
+
+**NOTE:** You may want to modify arch, float-abi or fpu to obtain the best performance out of the target CPU, however the defaults are recommended for now until you have a working build:
+```
+./configure --with-target-cflags='-march=armv7-a -mfloat-abi=softfp -mfpu=neon'
+```
+
+### 6.1. Advanced Configure Options
+
+
+**All platforms:**
+
+```
+--prefix=<path>
+```
+ specify path on target device. By default we will likely be packaging as org.xbmc.kodi and it will installed to $HOME/kodi/build/{org.xbmc.kodi}. All developer apps will get installed to this base path plus {your-app-name}
+
+```
+--enable-debug=<yes:no>
+```
+ enable debugging information (default is yes)
+
+```
+--disable-ccache
+```
+ disable ccache
+
+```
+--with-tarballs=<path>
+```
+ path where tarballs will be saved [prefix/xbmc-tarballs]
+
+```
+--with-cpu=<cpu>
+```
+ optional. specify target cpu. guessed if not specified
+
+```
+--with-linker=<linker>
+```
+ specify linker to use. (default is ld)
+
+```
+--with-platform=<platform>
+```
+ target platform
+
+```
+--enable-gplv3=<yes:no>
+```
+ enable gplv3 components. (default is yes)
+
+```
+--with-target-cflags=<cflags>
+```
+ C compiler flags (target)
+
+```
+--with-target-cxxflags=<cxxflags>
+```
+ C++ compiler flags (target)
+
+```
+--with-target-ldflags=<ldflags>
+```
+ linker flags. Use e.g. for -l<lib> (target)
+
+```
+--with-ffmpeg-options
+```
+ FFmpeg configure options, e.g. --enable-vaapi (not relevant however to webOS)
+
+**[back to top](#table-of-contents)**
+
+## 7. Generate Kodi Build files
+Before you can build Kodi, the build files have to be generated with CMake. CMake is built as part of the dependencies and doesn't have to be installed separately. A toolchain file is also generated and is used to configure CMake.
+Default behaviour will not build binary addons. To add addons to your build go to **[Add Binary Addons to Project](#52-(Optional)-Add-Binary-Addons-to-Project)**
+
+## 7.1. Generate Project Files
+
+Before you can build Kodi, the project has to be generated with CMake. CMake is built as part of the dependencies and doesn't have to be installed separately. A toolchain file is also generated and is used to configure CMake.
+
+Generate project for webOS:
+```
+make -C tools/depends/target/cmakebuildsys
+```
+
+**TIP:** BUILD_DIR can be omitted, and project will be created in $HOME/kodi/build
+Change all relevant paths onwards if omitted.
+
+Additional cmake arguments can be supplied via the CMAKE_EXTRA_ARGUMENTS command line variable
+
+An example of extra arguments to remove dependencies dbus, CEC and pipewire from the build:
+````
+make -C tools/depends/target/cmakebuildsys BUILD_DIR=/media/developer/apps/usr/palm/applications/org.xbmc.kodi \
+ CMAKE_EXTRA_ARGUMENTS="-DCORE_PLATFORM_NAME=webos -DENABLE_DBUS=OFF -DENABLE_CEC=OFF -DENABLE_PIPEWIRE=OFF -DHAVE_LINUX_UDMABUF=OFF"
+````
+
+## 7.2. Add Binary Addons to Project
+
+You can find a complete list of available binary add-ons **[here](https://github.com/xbmc/repo-binary-addons)**.
+
+Binary addons are optional.
+
+To build all add-ons:
+```
+make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons PREFIX=$HOME/kodi/build/tools/webOS/packaging
+```
+
+Build specific add-ons:
+```
+make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons PREFIX=$HOME/kodi/build/tools/webOS/packaging ADDONS="audioencoder.flac pvr.vdr.vnsi audiodecoder.snesapu"
+```
+
+Build a specific group of add-ons:
+```
+make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons PREFIX=$HOME/kodi/build/tools/webOS/packaging ADDONS="pvr.*"
+```
+
+To build specific addons or help with regular expression usage for ADDONS_TO_BUILD, view ADDONS_TO_BUILD section located at [Kodi add-ons CMake based buildsystem](../cmake/addons/README.md)
+
+**TIP:** Binary add-ons added to the generated project can be built independently of the Kodi app by selecting the scheme/target `binary-addons` in the project.
+
+**[back to top](#table-of-contents)** | **[back to section top](#5-Generate-Kodi-Build-files)**
+
+## 8. Build
+
+### 8.1. Build kodi binary
+
+In '$HOME/kodi/build`
+
+```
+make -j$(getconf _NPROCESSORS_ONLN)
+```
+
+**WARNING:** Building for simulator is NOT supported.
+
+**[back to top](#table-of-contents)** | **[back to section top](#6-Build)**
+
+## 9 Packaging kodi to distribute as an IPK
+
+## 9.1 Create the IPK
+
+CMake generates a target called `ipk` which will package Kodi ready for distribution.
+
+Create package:
+```
+make ipk
+```
+
+Generated `ipk` file will be inside the build dir. The filename may differ from this guide which is due to the version of Kodi which at time of writing will create a `ipk` called org.xbmc.kodi_20.90.101_all.ipk.
+
+## 10 Using ares-cli to install
+
+Alternatively, you can use ares-cli to give you more control of which device to install to.
+
+```
+ares-install ./org.xbmc.kodi_20.90.101_arm.ipk --d <your tv>
+e.g. [LG]_webOS_TV_OLED65C24LA
+```
+
+## 11. Debugging
+
+You can connect over ssh directly to your webOS device to debug any issues:
+
+```
+ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedAlgorithms=+ssh-rsa -i ~/.ssh/\<your tv>-p 9922 prisoner@<ip of tv> bash -i
+```
+
+You will be put into /media/developer by default.
+cd `/media/developer/apps/usr/palm/applications/org.xbmc.kodi/.kodi/temp` to find kodi.log
+
+You can also edit `kodi.sh` and place strace just before launching kodi to debug any missing libraries:
+
+```
+strace -t -o /media/developer/apps/usr/palm/applications/org.xbmc.kodi/trace.temp ./kodi-webos --debug
+```
+
+## 12. Uninstall
+
+We use the same make command or ares-cli tools to uninstall.
+
+## 12.1. Using make to uninstall
+
+```
+cd $HOME/kodi/tools/webOS/packaging
+make uninstall
+```
+
+## 12.2. Using ares-cli to uninstall
+
+```
+ares-install --remove org.xbmc.kodi --d <your tv>
+e.g. [LG]_webOS_TV_OLED65C24LA
+```
+
+**[back to top](#table-of-contents)**
+
diff --git a/docs/resources/webos.svg b/docs/resources/webos.svg
new file mode 100644
index 0000000000..e2fa085599
--- /dev/null
+++ b/docs/resources/webos.svg
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="100"
+ height="100"
+ version="1.1"
+ viewBox="0 0 26.458333 26.458334"
+ id="svg26"
+ sodipodi:docname="webos"
+ inkscape:version="1.2.2 (732a01da63, 2022-12-09, custom)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs
+ id="defs30">
+ <rect
+ x="451.29898"
+ y="586.10344"
+ width="761.80025"
+ height="574.33171"
+ id="rect770" />
+ </defs>
+ <sodipodi:namedview
+ id="namedview28"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ showgrid="false"
+ inkscape:zoom="9.86"
+ inkscape:cx="59.381339"
+ inkscape:cy="60.699797"
+ inkscape:window-width="1850"
+ inkscape:window-height="1136"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="g24" />
+ <metadata
+ id="metadata18">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(0 -270.54)"
+ id="g24">
+ <rect
+ x="-1.4211e-14"
+ y="270.54"
+ width="26.458"
+ height="26.458"
+ fill="#2b2e34"
+ stroke-width=".27763"
+ id="rect20" />
+ <text
+ xml:space="preserve"
+ style="font-size:3.175px;fill:#ffffff;stroke-width:0.264583"
+ x="8.4137917"
+ y="285.82489"
+ id="text762"><tspan
+ sodipodi:role="line"
+ id="tspan760"
+ style="stroke-width:0.264583"
+ x="8.4137917"
+ y="285.82489" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:3.175px;letter-spacing:-0.53975px;word-spacing:0px;fill:#ffffff;stroke-width:0.264583"
+ x="3.7344356"
+ y="286.08652"
+ id="text766"><tspan
+ sodipodi:role="line"
+ id="tspan764"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.99722px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:0.264583"
+ x="3.7344356"
+ y="286.08652">web<tspan
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.35px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal"
+ id="tspan774">OS</tspan></tspan></text>
+ <text
+ xml:space="preserve"
+ transform="matrix(0.26458333,0,0,0.26458333,0,270.54)"
+ id="text768"
+ style="white-space:pre;shape-inside:url(#rect770);display:inline;fill:#ffffff" />
+ </g>
+</svg>
diff --git a/tools/depends/README.md b/tools/depends/README.md
index 64fb3f0aa1..271f5f653b 100644
--- a/tools/depends/README.md
+++ b/tools/depends/README.md
@@ -50,6 +50,9 @@ Paths below are examples. If you want to build Kodi, follow our **[build guides]
**ARM (codesourcery/lenaro/etc)**
`./configure --with-toolchain=/opt/toolchains/my-example-toolchain/ --prefix=/opt/xbmc-deps --host=arm-linux-gnueabi --with-rendersystem=gles`
+**webos (buildroot-nc4)**
+`./configure --with-toolchain=/opt/toolchains/arm-webos-linux-gnueabi_sdk-buildroot --prefix=/opt/xbmc-deps --host=arm-webos-linux-gnueabi`
+
**Native**
`./configure --with-toolchain=/usr --prefix=/opt/xbmc-deps --host=x86_64-linux-gnu --with-rendersystem=gl`
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
index b82c47b443..beff432e22 100644
--- a/tools/depends/configure.ac
+++ b/tools/depends/configure.ac
@@ -129,7 +129,6 @@ AC_ARG_WITH([ffmpeg-options],
[ffmpeg_options=$withval],
[ffmpeg_options=default])
-
if test "$use_ccache" = "yes"; then
AC_CHECK_PROG(HAVE_CCACHE,ccache,"yes","no",)
if test "x$HAVE_CCACHE" = "xno" ; then
@@ -363,6 +362,21 @@ case $host in
#android builds are always cross
cross_compiling="yes"
;;
+ arm-webos-linux-gnueabi|arm-starfish-linux-gnueabi)
+ meson_cpu="arm"
+ if test "x$use_cpu" = "xauto"; then
+ use_cpu="armeabi-v7a"
+ fi
+ use_toolchain="${use_toolchain:-/usr}"
+ platform_cflags="-fPIC -DPIC -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon"
+ platform_cxxflags="$platform_cflags -static-libstdc++"
+ optimize_flags="-Os"
+ platform_ldflags="-Wl,-rpath-link=$prefix/$deps_dir/lib"
+ platform_os="linux"
+ meson_system="linux"
+ target_platform="webos"
+ app_rendersystem="gles"
+ ;;
arm*-*-linux-gnu*|arm*-*-linux-uclibc*|aarch64*-*-linux-gnu*|aarch*-*-linux-be*)
case $host in
arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
@@ -377,9 +391,9 @@ case $host in
fi
use_toolchain="${use_toolchain:-/usr}"
platform_cflags="-fPIC -DPIC"
+ platform_cxxflags="$platform_cflags"
optimize_flags="-Os"
platform_ldflags="-Wl,-rpath-link=$prefix/$deps_dir/lib"
- platform_cxxflags="$platform_cflags"
platform_os="linux"
meson_system="linux"
target_platform="wayland gbm"
@@ -506,6 +520,8 @@ esac
case $use_platform in
ios|tvos|macos)
;;
+ webos)
+ ;;
auto)
;;
*)
@@ -524,7 +540,7 @@ case $build in
fi
esac
-if test "$platform_os" = "android"; then
+if test "$platform_os" = "android" || test "$target_platform" = "webos"; then
need_libiconv=1
else
AC_SEARCH_LIBS([iconv_open],iconv, link_iconv=$ac_cv_search_iconv_open, link_iconv=-liconv; AC_MSG_WARN("No iconv support in toolchain. Will build libiconv."); need_libiconv=1)
@@ -850,6 +866,7 @@ echo -e "asflags:\t\t $platform_asflags"
echo -e "cflags:\t\t $platform_cflags"
echo -e "cxxflags:\t\t $platform_cxxflags"
echo -e "ldflags:\t\t $platform_ldflags"
+echo -e "target_platform:\t $target_platform"
echo -e "platform_includes:\t $platform_includes"
echo -e "ffmpeg options:\t $ffmpeg_options"
echo -e "prefix:\t\t $prefix"
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
index 74e4f3e675..e353e6cc31 100644
--- a/tools/depends/target/Makefile
+++ b/tools/depends/target/Makefile
@@ -81,8 +81,6 @@ ifeq ($(OS),android)
LIBUUID = libuuid
endif
-DEPENDS := $(filter-out $(EXCLUDED_DEPENDS),$(DEPENDS))
-
ZLIB=
ifneq ($(HAS_ZLIB),1)
DEPENDS += zlib
@@ -133,8 +131,17 @@ ifeq ($(OS),linux)
else
DEPENDS += mesa
endif
+
+ ifeq ($(TARGET_PLATFORM),webos)
+ DEPENDS += webos-wayland-extensions
+ EXCLUDED_DEPENDS += dbus libcec linux-system-x11-libs pipewire
+
+ MESA_DEPS := $(filter-out $(EXCLUDED_DEPENDS),$(MESA_DEPS))
+ endif
endif
+DEPENDS := $(filter-out $(EXCLUDED_DEPENDS),$(DEPENDS))
+
.PHONY: $(DEPENDS)
all: .installed-$(PLATFORM)
diff --git a/tools/depends/target/webos-wayland-extensions/Makefile b/tools/depends/target/webos-wayland-extensions/Makefile
new file mode 100644
index 0000000000..8c4d4d3066
--- /dev/null
+++ b/tools/depends/target/webos-wayland-extensions/Makefile
@@ -0,0 +1,33 @@
+-include ../../Makefile.include
+include WEBOS-WAYLAND-EXTENSIONS-VERSION
+DEPS = WEBOS-WAYLAND-EXTENSIONS-VERSION Makefile ../../download-files.include
+
+ifeq ($(CROSS_COMPILING), yes)
+ DEPS += ../../Makefile.include
+else
+ ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+endif
+
+include ../../download-files.include
+all: .installed-$(PLATFORM)
+
+$(PLATFORM): $(DEPS) | $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE)
+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+
+.installed-$(PLATFORM): $(PLATFORM)
+ mkdir -p $(PREFIX)/share/wayland-webos $(PREFIX)/lib/pkgconfig
+ rm -f ${PREFIX}/lib/pkgconfig/wayland-webos-client.pc
+ echo 'includedir=$(PREFIX)/include' >> ${PREFIX}/lib/pkgconfig/wayland-webos-client.pc
+ echo 'Name: wayland-webos-client' >> ${PREFIX}/lib/pkgconfig/wayland-webos-client.pc
+ echo 'Description: wayland-webos-client' >> ${PREFIX}/lib/pkgconfig/wayland-webos-client.pc
+ echo 'Version: 1.0.0' >> ${PREFIX}/lib/pkgconfig/wayland-webos-client.pc
+
+ cp $(PLATFORM)/protocol/webos-shell.xml $(PREFIX)/share/wayland-webos
+ touch $@
+
+clean:
+ rm -f .installed-$(PLATFORM)
+
+distclean::
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/target/webos-wayland-extensions/WEBOS-WAYLAND-EXTENSIONS-VERSION b/tools/depends/target/webos-wayland-extensions/WEBOS-WAYLAND-EXTENSIONS-VERSION
new file mode 100644
index 0000000000..3fa5eb5345
--- /dev/null
+++ b/tools/depends/target/webos-wayland-extensions/WEBOS-WAYLAND-EXTENSIONS-VERSION
@@ -0,0 +1,4 @@
+LIBNAME=webos-wayland-extensions
+VERSION=45
+ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz
+SHA512=eca01641ddc9d4300e584da511a4d677f9330eea79206011a535e67dfa87fe755f777035407be468106628af830fb330030b930a679f1013057bce2d3f7cf3fc
diff --git a/tools/webOS/packaging/Makefile b/tools/webOS/packaging/Makefile
new file mode 100644
index 0000000000..5a0c39061d
--- /dev/null
+++ b/tools/webOS/packaging/Makefile
@@ -0,0 +1,129 @@
+include ../../depends/Makefile.include
+
+APP_BUILD_DIR:=$(shell cd $(PREFIX)/../..; pwd)
+APP_PACKAGE_DIR:=$(shell cd $(PREFIX)/../../..; pwd)/ipk-build
+APP_PACKAGE_LIB_DIR:=$(APP_PACKAGE_DIR)/$(notdir $(abspath $(PREFIX)/..))/$(notdir $(abspath $(PREFIX)))/lib
+APP_PACKAGE_LIBEXEC_DIR:=$(APP_PACKAGE_DIR)/$(notdir $(abspath $(PREFIX)/..))/$(notdir $(abspath $(PREFIX)))/libexec
+APP_LIB_DIR:=$(shell cd $(PREFIX)/lib; pwd)/
+APP_LIBEXEC_DIR:=$(shell cd $(PREFIX)/libexec; pwd)/
+APP_IPK_DIR:=$(shell cd $(PREFIX)/../../..; pwd)
+APP_PACKAGE:=$(shell awk '/APP_PACKAGE/ {print tolower($$2)}' $(VERSION.TXT))
+VERSION_CODE:=$(shell awk '/VERSION_CODE/ {print tolower($$2)}' $(VERSION.TXT))
+COMPANY_NAME:=$(shell awk '/COMPANY_NAME/ {print tolower($$2)}' $(VERSION.TXT))
+IPK:=$(APP_PACKAGE)_$(VERSION_CODE)_all.ipk
+ICON80:=icon.png
+ICON130:=largeIcon.png
+KEYBOARD:=keyboard.xml
+MAIN_APP:=kodi-$(TARGET_PLATFORM)
+
+COMPACT_IPK=compact-$(IPK)
+COMPACT_PACKAGE_DIR=$(shell cd $(PREFIX)/../../..; pwd)/compact-build
+
+ifneq ($(SDK_PATH),)
+ LIBSTDC_DIR:=$(shell cd $(SDK_PATH)/../; pwd)/target/usr/lib
+ LIBCRYPT_DIR:=$(shell cd $(SDK_PATH)/../; pwd)/target/lib
+endif
+
+.PHONY: all
+all: clean libs $(IPK)
+
+ipk: clean libs $(IPK)
+compact-ipk: clean compact-clean $(COMPACT_IPK)
+
+$(APP_PACKAGE_DIR):
+ mkdir -p $(APP_PACKAGE_DIR)
+
+$(APP_PACKAGE_DIR)/appinfo.json: appinfo.json.in Makefile | $(APP_PACKAGE_DIR)
+ sed -e 's|@APP_PACKAGE@|$(APP_PACKAGE)|g' \
+ -e 's|@VERSION_CODE@|$(VERSION_CODE)|g' \
+ -e 's|@COMPANY_NAME@|$(COMPANY_NAME)|g' \
+ -e 's|@APP_NAME@|$(APP_NAME)|g' < '$<' > '$@'
+
+$(APP_PACKAGE_DIR)/kodi.sh: kodi.sh.in Makefile | $(APP_DIR)
+ sed -e 's|@PREFIX@|$(PREFIX)|g' \
+ -e 's|@MAIN_APP@|$(MAIN_APP)|g' < '$<' > '$@'
+ chmod +x $(APP_PACKAGE_DIR)/kodi.sh
+
+$(APP_PACKAGE_DIR)/$(ICON80): $(ICON80) | $(APP_PACKAGE_DIR)
+ cp -t '$(APP_PACKAGE_DIR)' -- '$<'
+
+$(APP_PACKAGE_DIR)/$(ICON130): $(ICON130) | $(APP_PACKAGE_DIR)
+ cp -t '$(APP_PACKAGE_DIR)' -- '$<'
+
+$(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD): $(KEYBOARD) | $(APP_PACKAGE_DIR)
+ mkdir -p $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps
+ cp -t '$(APP_PACKAGE_DIR)/.kodi/userdata/keymaps' -- '$<'
+
+$(IPK): $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) \
+ $(APP_PACKAGE_DIR)/appinfo.json $(APP_PACKAGE_DIR)/kodi.sh \
+ $(APP_PACKAGE_DIR)/$(ICON80) $(APP_PACKAGE_DIR)/$(ICON130) | $(APP_PACKAGE_DIR)
+ cp $(APP_BUILD_DIR)/$(MAIN_APP) $(APP_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/addons $(APP_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/media $(APP_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/system $(APP_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/userdata $(APP_PACKAGE_DIR)
+ ares-package \
+ -o '$(APP_IPK_DIR)' \
+ '$(APP_PACKAGE_DIR)'
+
+$(COMPACT_IPK): $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) \
+ $(APP_PACKAGE_DIR)/appinfo.json $(APP_PACKAGE_DIR)/kodi.sh \
+ $(APP_PACKAGE_DIR)/$(ICON80) $(APP_PACKAGE_DIR)/$(ICON130) | $(APP_PACKAGE_DIR)
+ mkdir -p $(COMPACT_PACKAGE_DIR)
+ mkdir -p $(COMPACT_PACKAGE_DIR)/.kodi/userdata/keymaps
+ cp $(APP_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD) $(COMPACT_PACKAGE_DIR)/.kodi/userdata/keymaps/$(KEYBOARD)
+ cp $(APP_PACKAGE_DIR)/appinfo.json $(COMPACT_PACKAGE_DIR)/appinfo.json
+ cp $(APP_PACKAGE_DIR)/kodi.sh $(COMPACT_PACKAGE_DIR)/kodi.sh
+ cp $(APP_PACKAGE_DIR)/$(ICON80) $(COMPACT_PACKAGE_DIR)/$(ICON80)
+ cp $(APP_PACKAGE_DIR)/$(ICON130) $(COMPACT_PACKAGE_DIR)/$(ICON130)
+ cp -R $(APP_BUILD_DIR)/addons $(COMPACT_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/media $(COMPACT_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/system $(COMPACT_PACKAGE_DIR)
+ cp -R $(APP_BUILD_DIR)/userdata $(COMPACT_PACKAGE_DIR)
+ cp $(APP_BUILD_DIR)/$(MAIN_APP) $(COMPACT_PACKAGE_DIR)
+ ares-package \
+ -o '$(APP_IPK_DIR)' \
+ '$(COMPACT_PACKAGE_DIR)'
+
+.PHONY: libs
+libs:
+ mkdir -p $(APP_PACKAGE_LIB_DIR)
+ cp -R $(APP_LIB_DIR)* $(APP_PACKAGE_LIB_DIR)
+ mkdir -p $(APP_PACKAGE_LIBEXEC_DIR)
+ cp -R $(APP_LIBEXEC_DIR)* $(APP_PACKAGE_LIBEXEC_DIR)
+ifneq ($(LIBSTDC_DIR),)
+ cp -P $(LIBSTDC_DIR)/libstdc++.so* $(APP_PACKAGE_LIB_DIR)
+ rm $(APP_PACKAGE_LIB_DIR)/libstdc++.so.6.0.30-gdb.py
+endif
+ifneq ($(LIBCRYPT_DIR),)
+ cp -P $(LIBCRYPT_DIR)/libcrypt* $(APP_PACKAGE_LIB_DIR)
+endif
+ rm -f $(APP_PACKAGE_LIB_DIR)/*.a
+ rm -f $(APP_PACKAGE_LIB_DIR)/*.la
+ rm -f $(APP_PACKAGE_LIB_DIR)/libEGL.so*
+ rm -f $(APP_PACKAGE_LIB_DIR)/libGLESv2.so*
+ rm -f $(APP_PACKAGE_LIB_DIR)/libasound.*
+ rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-client.so*
+ rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-server.so*
+ rm -f $(APP_PACKAGE_LIB_DIR)/libwayland-egl.so*
+
+.PHONY: install
+install:
+ ares-install '$(APP_IPK_DIR)/$(IPK)'
+
+.PHONY: launch
+launch:
+ ares-launch '$(APP_PACKAGE)'
+
+.PHONY: uninstall
+uninstall:
+ ares-install --remove '$(APP_PACKAGE)'
+
+.PHONY: clean
+clean:
+ rm -f -- '$(IPK)'
+ rm -rf -- '$(APP_PACKAGE_DIR)'
+
+.PHONY: compact-clean
+compact-clean:
+ rm -rf -- '$(COMPACT_PACKAGE_DIR)'
diff --git a/tools/webOS/packaging/appinfo.json.in b/tools/webOS/packaging/appinfo.json.in
new file mode 100644
index 0000000000..8a66b536cb
--- /dev/null
+++ b/tools/webOS/packaging/appinfo.json.in
@@ -0,0 +1,12 @@
+{
+ "id": "@APP_PACKAGE@",
+ "version": "@VERSION_CODE@",
+ "vendor": "@COMPANY_NAME@",
+ "type": "native",
+ "main": "kodi.sh",
+ "title": "@APP_NAME@",
+ "icon": "icon.png",
+ "largeIcon": "largeIcon.png",
+ "noSplashOnLaunch": true,
+ "spinnerOnLaunch": false
+}
diff --git a/tools/webOS/packaging/icon.png b/tools/webOS/packaging/icon.png
new file mode 100755
index 0000000000..247a9505f6
--- /dev/null
+++ b/tools/webOS/packaging/icon.png
Binary files differ
diff --git a/tools/webOS/packaging/keyboard.xml b/tools/webOS/packaging/keyboard.xml
new file mode 100644
index 0000000000..587bb473c2
--- /dev/null
+++ b/tools/webOS/packaging/keyboard.xml
@@ -0,0 +1,7 @@
+<keymap>
+ <global>
+ <keyboard>
+ <key id="61952">Back</key>
+ </keyboard>
+ </global>
+</keymap>
diff --git a/tools/webOS/packaging/kodi.sh.in b/tools/webOS/packaging/kodi.sh.in
new file mode 100755
index 0000000000..695b2e1064
--- /dev/null
+++ b/tools/webOS/packaging/kodi.sh.in
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@PREFIX@/lib
+export WAYLAND_DISPLAY=wayland-0
+if [[ -z "${GST_PLUGIN_SCANNER_1_0}" ]]; then
+ export GST_PLUGIN_SCANNER_1_0='@PREFIX@/libexec/gstreamer-1.0/gst-plugin-scanner'
+else
+ if [ ! -d "${GST_PLUGIN_SCANNER_1_0}" ]; then
+ export GST_PLUGIN_SCANNER_1_0='@PREFIX@/libexec/gstreamer-1.0/gst-plugin-scanner'
+ fi
+fi
+if [ ! -d @PREFIX@/share/X11 ]; then
+ mkdir -p @PREFIX@/share/X11;
+ ln -s /usr/share/X11/xkb @PREFIX@/share/X11
+fi
+./@MAIN_APP@
diff --git a/tools/webOS/packaging/largeIcon.png b/tools/webOS/packaging/largeIcon.png
new file mode 100644
index 0000000000..42bdf286a8
--- /dev/null
+++ b/tools/webOS/packaging/largeIcon.png
Binary files differ
diff --git a/xbmc/windowing/wayland/CMakeLists.txt b/xbmc/windowing/wayland/CMakeLists.txt
index 5628ed86c9..df77f924ba 100644
--- a/xbmc/windowing/wayland/CMakeLists.txt
+++ b/xbmc/windowing/wayland/CMakeLists.txt
@@ -62,6 +62,15 @@ if(OPENGLES_FOUND)
list(APPEND SOURCES WinSystemWaylandEGLContextGLES.cpp)
list(APPEND HEADERS WinSystemWaylandEGLContextGLES.h)
endif()
+if(TARGET_WEBOS)
+ set_source_files_properties(${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.cpp
+ ${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.hpp
+ PROPERTIES GENERATED TRUE)
+ list(APPEND SOURCES ShellSurfaceWebOSShell.cpp
+ ${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.cpp)
+ list(APPEND HEADERS ShellSurfaceWebOSShell.h
+ ${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-webos-protocols.hpp)
+endif()
core_add_library(windowing_WAYLAND)
diff --git a/xbmc/windowing/wayland/ShellSurfaceWebOSShell.cpp b/xbmc/windowing/wayland/ShellSurfaceWebOSShell.cpp
new file mode 100644
index 0000000000..95c8c37a98
--- /dev/null
+++ b/xbmc/windowing/wayland/ShellSurfaceWebOSShell.cpp
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2017-2023 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "ShellSurfaceWebOSShell.h"
+
+#include "CompileInfo.h"
+#include "Registry.h"
+#include "platform/Environment.h"
+#include "utils/log.h"
+
+using namespace KODI::WINDOWING::WAYLAND;
+using namespace std::placeholders;
+
+using namespace wayland;
+
+namespace
+{
+/*
+ WebOS always is 1920x1080
+*/
+constexpr int WEBOS_UI_WIDTH = 1920;
+constexpr int WEBOS_UI_HEIGHT = 1080;
+} // unnamed namespace
+
+CShellSurfaceWebOSShell::CShellSurfaceWebOSShell(IShellSurfaceHandler& handler,
+ CConnection& connection,
+ const wayland::surface_t& surface,
+ const std::string& title,
+ const std::string& className)
+ : m_handler{handler}
+{
+ {
+ CRegistry registry{connection};
+ registry.RequestSingleton(m_shell, 1, 1);
+ registry.RequestSingleton(m_webos_shell, 1, 2);
+ registry.Bind();
+ }
+
+ m_shellSurface = m_shell.get_shell_surface(surface);
+
+ m_webos_shellSurface = m_webos_shell.get_shell_surface(surface);
+
+ m_webos_shellSurface.on_state_changed() = [this](std::uint32_t state) {
+ switch (state)
+ {
+ case static_cast<uint32_t>(webos_shell_surface_state::fullscreen):
+ CLog::Log(LOGDEBUG, "webOS notification - Changed to full screen");
+ m_handler.OnConfigure(0, {WEBOS_UI_WIDTH, WEBOS_UI_HEIGHT}, m_surfaceState);
+ break;
+ case static_cast<uint32_t>(webos_shell_surface_state::minimized):
+ CLog::Log(LOGDEBUG, "webOS notification - Changed to minimized");
+ break;
+ }
+ };
+
+ m_webos_shellSurface.on_close() = [this]() {
+ CLog::Log(LOGDEBUG, "webOS notification - Close notification received");
+ m_handler.OnClose();
+ };
+
+ std::string appId = CEnvironment::getenv("APP_ID");
+ if (appId.empty())
+ {
+ appId = CCompileInfo::GetPackage();
+ }
+
+ std::string displayId = CEnvironment::getenv("DISPLAY_ID");
+ if (displayId.empty())
+ {
+ displayId = "0";
+ }
+
+ CLog::Log(LOGDEBUG, "Passing appId {} and displayAffinity {} to wl_webos_shell", appId,
+ displayId);
+ m_webos_shellSurface.set_property("appId", appId);
+ m_webos_shellSurface.set_property("displayAffinity", displayId);
+
+ // Allow the back button the LG remote to be passed to Kodi and not intercepted
+ m_webos_shellSurface.set_property("_WEBOS_ACCESS_POLICY_KEYS_BACK", "true");
+
+ m_surfaceState.set(STATE_ACTIVATED);
+ m_shellSurface.set_class(className);
+ m_shellSurface.set_title(title);
+}
+
+void CShellSurfaceWebOSShell::SetFullScreen(const wayland::output_t& output, float refreshRate)
+{
+ m_shellSurface.set_fullscreen(wayland::shell_surface_fullscreen_method::driver,
+ std::round(refreshRate * 1000.0f), output);
+ m_surfaceState.set(STATE_FULLSCREEN);
+}
+
+void CShellSurfaceWebOSShell::SetWindowed()
+{
+ m_shellSurface.set_toplevel();
+ m_surfaceState.reset(STATE_FULLSCREEN);
+}
+
+void CShellSurfaceWebOSShell::SetMaximized()
+{
+ m_shellSurface.set_maximized(wayland::output_t());
+ m_surfaceState.set(STATE_MAXIMIZED);
+}
+
+void CShellSurfaceWebOSShell::UnsetMaximized()
+{
+ m_surfaceState.reset(STATE_MAXIMIZED);
+}
+
+void CShellSurfaceWebOSShell::StartMove(const wayland::seat_t& seat, std::uint32_t serial)
+{
+ m_shellSurface.move(seat, serial);
+}
+
+void CShellSurfaceWebOSShell::StartResize(const wayland::seat_t& seat,
+ std::uint32_t serial,
+ wayland::shell_surface_resize edge)
+{
+ m_shellSurface.resize(seat, serial, edge);
+}
diff --git a/xbmc/windowing/wayland/ShellSurfaceWebOSShell.h b/xbmc/windowing/wayland/ShellSurfaceWebOSShell.h
new file mode 100644
index 0000000000..2020672560
--- /dev/null
+++ b/xbmc/windowing/wayland/ShellSurfaceWebOSShell.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017-2023 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "Connection.h"
+#include "ShellSurface.h"
+#include "wayland-webos-protocols.hpp"
+
+namespace KODI
+{
+namespace WINDOWING
+{
+namespace WAYLAND
+{
+
+class CShellSurfaceWebOSShell : public IShellSurface
+{
+public:
+ /**
+ * Construct wl_shell_surface for given surface
+ *
+ * \parma handler shell surface handler
+ * \param connection connection global
+ * \param surface surface to make shell surface for
+ * \param title title of the surfae
+ * \param className class of the surface, which should match the name of the
+ * .desktop file of the application
+ */
+ CShellSurfaceWebOSShell(IShellSurfaceHandler& handler,
+ CConnection& connection,
+ wayland::surface_t const& surface,
+ const std::string& title,
+ const std::string& className);
+
+ void Initialize() override{};
+
+ void SetFullScreen(wayland::output_t const& output, float refreshRate) override;
+ void SetWindowed() override;
+ void SetMaximized() override;
+ void UnsetMaximized() override;
+ void SetMinimized() override{};
+ void SetWindowGeometry(CRectInt geometry) override{};
+ void AckConfigure(std::uint32_t serial) override{};
+
+ void StartMove(const wayland::seat_t& seat, std::uint32_t serial) override;
+ void StartResize(const wayland::seat_t& seat,
+ std::uint32_t serial,
+ wayland::shell_surface_resize edge) override;
+ void ShowShellContextMenu(const wayland::seat_t& seat,
+ std::uint32_t serial,
+ CPointInt position) override{};
+
+private:
+ IShellSurfaceHandler& m_handler;
+ wayland::shell_t m_shell;
+ wayland::shell_surface_t m_shellSurface;
+ StateBitset m_surfaceState;
+ wayland::webos_shell_t m_webos_shell;
+ wayland::webos_shell_surface_t m_webos_shellSurface;
+};
+
+} // namespace WAYLAND
+} // namespace WINDOWING
+} // namespace KODI
diff --git a/xbmc/windowing/wayland/WinSystemWayland.cpp b/xbmc/windowing/wayland/WinSystemWayland.cpp
index 9733339ad8..d710a957b4 100644
--- a/xbmc/windowing/wayland/WinSystemWayland.cpp
+++ b/xbmc/windowing/wayland/WinSystemWayland.cpp
@@ -53,6 +53,10 @@
# include "windowing/linux/OSScreenSaverFreedesktop.h"
#endif
+#ifdef TARGET_WEBOS
+#include "ShellSurfaceWebOSShell.h"
+#endif
+
using namespace KODI::WINDOWING;
using namespace KODI::WINDOWING::WAYLAND;
using namespace std::placeholders;
@@ -302,6 +306,10 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
// Try with this resolution if compositor does not say otherwise
UpdateSizeVariables({res.iWidth, res.iHeight}, m_scale, m_shellSurfaceState, false);
+#ifdef TARGET_WEBOS
+ m_shellSurface.reset(new CShellSurfaceWebOSShell(*this, *m_connection, m_surface, name,
+ std::string(CCompileInfo::GetAppName())));
+#else
// Use AppName as the desktop file name. This is required to lookup the app icon of the same name.
m_shellSurface.reset(CShellSurfaceXdgShell::TryCreate(*this, *m_connection, m_surface, name,
std::string(CCompileInfo::GetAppName())));
@@ -316,6 +324,7 @@ bool CWinSystemWayland::CreateNewWindow(const std::string& name,
m_shellSurface.reset(new CShellSurfaceWlShell(*this, *m_connection, m_surface, name,
std::string(CCompileInfo::GetAppName())));
}
+#endif
if (fullScreen)
{