Compare commits
156 Commits
multi-seat
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
27d5c8cc73 | |
|
|
3bf30e97e5 | |
|
|
29ac51b15e | |
|
|
f50669edc6 | |
|
|
04791bc889 | |
|
|
1866331471 | |
|
|
f7e4a195c6 | |
|
|
8aa33384f2 | |
|
|
bbdbc40a94 | |
|
|
b2661a3d86 | |
|
|
6547558cc7 | |
|
|
66193ba1bc | |
|
|
5bde9683eb | |
|
|
ca8de83d47 | |
|
|
5af6a3903d | |
|
|
f6af3a539f | |
|
|
3f03884083 | |
|
|
777e0f2a7b | |
|
|
7c11939015 | |
|
|
4827731cfc | |
|
|
232cf374c2 | |
|
|
16240cba52 | |
|
|
8fdd5703a6 | |
|
|
d9cd9e855d | |
|
|
84379d1ca5 | |
|
|
0544ca405a | |
|
|
b10c1f427b | |
|
|
5b4d7b5de5 | |
|
|
e843122e9e | |
|
|
f4386256ca | |
|
|
b0601f90d1 | |
|
|
801e2fbf24 | |
|
|
5d16c8cada | |
|
|
2bc9ef62fe | |
|
|
fc6d684513 | |
|
|
5c701f8767 | |
|
|
51f403769e | |
|
|
e03fd2fdb3 | |
|
|
4ef86fc3fd | |
|
|
f2ac25fc05 | |
|
|
6ec120d449 | |
|
|
03094c5d8a | |
|
|
04bf8b3ddc | |
|
|
794124ba68 | |
|
|
9556ef8950 | |
|
|
23192a4b14 | |
|
|
fa1e1e6a18 | |
|
|
e66c0a1b74 | |
|
|
1411fb2ef7 | |
|
|
a43e0ed3d4 | |
|
|
1cbcd3e402 | |
|
|
90e2762dcc | |
|
|
e7d27a914c | |
|
|
8a8bb8dec5 | |
|
|
69c55e454f | |
|
|
18026e2c1a | |
|
|
81f014bf20 | |
|
|
0072a5513a | |
|
|
e344a1e60f | |
|
|
342396e1d6 | |
|
|
7bfcba9efd | |
|
|
e14a6a4935 | |
|
|
3aa68efc92 | |
|
|
547da09cbf | |
|
|
c2094e85d2 | |
|
|
511473c286 | |
|
|
b3e5f82d83 | |
|
|
cf91ae1312 | |
|
|
d1adcf4739 | |
|
|
4cb9bd7c47 | |
|
|
10652f2741 | |
|
|
672fdba375 | |
|
|
af951c4194 | |
|
|
501533e4c8 | |
|
|
7642cb91cf | |
|
|
b48e9f3a7d | |
|
|
c48f8dcf6a | |
|
|
3ac5fb78b4 | |
|
|
6c921b8ed4 | |
|
|
a1895f9161 | |
|
|
7176521287 | |
|
|
d2df8a0a11 | |
|
|
26b0e3eebb | |
|
|
1e6625bd9b | |
|
|
aa645014b8 | |
|
|
795309a4aa | |
|
|
bba9eca457 | |
|
|
3a013bcf5a | |
|
|
4cb0da6d21 | |
|
|
97c07bd06f | |
|
|
78ee985666 | |
|
|
ce2c4057b4 | |
|
|
e4ca014d0e | |
|
|
0ef3153e20 | |
|
|
f96555f5e3 | |
|
|
b7b6708a4b | |
|
|
7e13237fd7 | |
|
|
5cee95f2aa | |
|
|
a503276e46 | |
|
|
72f4ff54a6 | |
|
|
c3501eac2b | |
|
|
5f767e541f | |
|
|
efa48c3154 | |
|
|
cd0478c044 | |
|
|
5a8e15f1c7 | |
|
|
60c30ec0db | |
|
|
b68ea9f76e | |
|
|
6c1aab65be | |
|
|
837d349e96 | |
|
|
a6134c2e40 | |
|
|
26b95540cd | |
|
|
7039d9ede6 | |
|
|
531c316379 | |
|
|
41aac0ddea | |
|
|
826fe21051 | |
|
|
ffa43d0167 | |
|
|
c4aba6382e | |
|
|
e321eed150 | |
|
|
9adc345b56 | |
|
|
e71660c914 | |
|
|
3a471672c6 | |
|
|
7d4aec0795 | |
|
|
3c6c4c01e9 | |
|
|
6a7b46ad64 | |
|
|
54e8ed840b | |
|
|
7c74bf1e17 | |
|
|
2427b2025a | |
|
|
644b7315d3 | |
|
|
2a0093ad46 | |
|
|
aee46508f7 | |
|
|
ede2f8230d | |
|
|
df2a7442b2 | |
|
|
2f48f6d110 | |
|
|
1cf99b5540 | |
|
|
9d4c3cb5cd | |
|
|
1713074802 | |
|
|
34c158934e | |
|
|
6afd8348fa | |
|
|
77d2cd1936 | |
|
|
dd7148ee5d | |
|
|
da8cf4ad11 | |
|
|
b9d8d7a756 | |
|
|
327ab03444 | |
|
|
fb35b0c890 | |
|
|
71aa66bff3 | |
|
|
267bb639ad | |
|
|
ad74f7ad57 | |
|
|
1570936d55 | |
|
|
7a12c9ad62 | |
|
|
7acf621712 | |
|
|
28ca983e8d | |
|
|
b8b0dc8b9f | |
|
|
76f9538656 | |
|
|
e6447c783e | |
|
|
9bfa75519e | |
|
|
c31cda69cb |
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: export
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
persist-credentials: false
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
name: Build qwlroots on Arch Linux (independent)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/qwlroots-archlinux-build.yml'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/qwlroots-archlinux-build.yml'
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run in container
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Syu --noconfirm
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm qt6-base cmake pkgconfig wlroots0.19 pixman wayland-protocols wlr-protocols
|
||||
pacman -Syu --noconfirm clang ninja base-devel git
|
||||
|
||||
- name: Configure and build qwlroots
|
||||
working-directory: qwlroots
|
||||
run: |
|
||||
echo "Working directory:" $PWD
|
||||
cmake --preset ci
|
||||
cmake --build --preset ci
|
||||
|
||||
- name: Install qwlroots to staging directory
|
||||
working-directory: qwlroots
|
||||
run: |
|
||||
echo "Installing qwlroots to staging directory..."
|
||||
mkdir -p /tmp/qwlroots-install
|
||||
DESTDIR=/tmp/qwlroots-install cmake --install build
|
||||
echo "✅ qwlroots installed to staging directory"
|
||||
|
||||
echo "Installed files:"
|
||||
find /tmp/qwlroots-install -type f | head -20
|
||||
echo "Total files installed: $(find /tmp/qwlroots-install -type f | wc -l)"
|
||||
|
||||
- name: Create qwlroots installation package
|
||||
run: |
|
||||
cd /tmp/qwlroots-install
|
||||
|
||||
# Install zip if not available
|
||||
pacman -Syu --noconfirm zip
|
||||
|
||||
# Create package info
|
||||
echo "Creating package info..."
|
||||
cat > PACKAGE_INFO.txt << EOF
|
||||
Package: qwlroots-archlinux-build
|
||||
Version: $(date +%Y%m%d-%H%M%S)
|
||||
Architecture: x86_64
|
||||
Built-on: Arch Linux
|
||||
CMake-Config: Default configuration
|
||||
|
||||
Installation Instructions:
|
||||
1. Extract this package to /
|
||||
2. Run: sudo ldconfig (if libraries are included)
|
||||
3. Ensure dependencies are installed on target system
|
||||
|
||||
Files included in this package:
|
||||
EOF
|
||||
find . -type f | sort >> PACKAGE_INFO.txt
|
||||
|
||||
# Create the zip package
|
||||
zip -r /tmp/qwlroots-archlinux-$(date +%Y%m%d-%H%M%S).zip .
|
||||
echo "✅ qwlroots installation package created"
|
||||
|
||||
ls -la /tmp/qwlroots-archlinux-*.zip
|
||||
|
||||
- name: Upload qwlroots ArchLinux build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qwlroots-archlinux-build
|
||||
path: "/tmp/qwlroots-archlinux-*.zip"
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
name: Build qwlroots on Debian unstable (independent)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/qwlroots-debian-build.yml'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/qwlroots-debian-build.yml'
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: debian:unstable
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
working-directory: qwlroots
|
||||
run: |
|
||||
# Configure apt sources for unstable
|
||||
echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list
|
||||
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y devscripts equivs
|
||||
|
||||
# Add deepin community repository to install wlr-protocols
|
||||
echo "deb [trusted=yes] https://community-packages.deepin.com/beige/ crimson main commercial community" > /etc/apt/sources.list.d/deepin-community.list
|
||||
|
||||
# Update package lists (ignore signature errors for this temporary repo)
|
||||
apt-get update --allow-unauthenticated
|
||||
|
||||
# Install wlr-protocols package directly
|
||||
apt-get install -y --allow-unauthenticated wlr-protocols
|
||||
# Remove deepin repository to avoid system pollution
|
||||
rm -f /etc/apt/sources.list.d/deepin-community.list
|
||||
apt-get update
|
||||
|
||||
# Install other build dependencies from control file
|
||||
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||
|
||||
- name: Build qwlroots deb package
|
||||
working-directory: qwlroots
|
||||
run: |
|
||||
dpkg-buildpackage -uc -us -b
|
||||
echo "✅ qwlroots deb package built successfully!"
|
||||
ls -la ../*.deb
|
||||
|
||||
- name: Upload qwlroots deb packages as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qwlroots-deb-packages
|
||||
path: "*.deb"
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
name: Build treeland on Arch Linux
|
||||
|
||||
# This workflow builds treeland with merged waylib and qwlroots code
|
||||
# Dependencies are based on the official ArchLinux PKGBUILD plus
|
||||
# additional dependencies from the integrated waylib and qwlroots code
|
||||
# treeland-protocols-git is installed from AUR
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
steps:
|
||||
- name: Run in container
|
||||
run: |
|
||||
cat /etc/pacman.d/mirrorlist
|
||||
pacman-key --init
|
||||
pacman --noconfirm --noprogressbar -Syu
|
||||
|
||||
- name: Install base dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm --noprogressbar base-devel git cmake ninja pkgconfig clang make
|
||||
pacman -Syu --noconfirm --noprogressbar fakeroot meson sudo
|
||||
|
||||
- name: Install Qt6 dependencies
|
||||
run: |
|
||||
# Qt6 dependencies matching qwlroots and waylib builds
|
||||
pacman -Syu --noconfirm --noprogressbar qt6-base qt6-declarative qt6-wayland qt6-tools
|
||||
|
||||
- name: Install graphics and wayland dependencies
|
||||
run: |
|
||||
# Core graphics and wayland dependencies (matching qwlroots and waylib builds)
|
||||
pacman -Syu --noconfirm --noprogressbar pixman vulkan-headers wayland wayland-protocols wlr-protocols
|
||||
pacman -Syu --noconfirm --noprogressbar wlroots0.19 libinput pam systemd-libs jemalloc gcc-libs glibc
|
||||
|
||||
- name: Install additional waylib/qwlroots dependencies
|
||||
run: |
|
||||
# Additional dependencies from waylib and qwlroots build configs
|
||||
pacman -Syu --noconfirm --noprogressbar libdrm xcb-util-errors libxdmcp
|
||||
|
||||
- name: Install DTK dependencies
|
||||
run: |
|
||||
# Try to install DTK from available packages
|
||||
# If not available, the build will proceed without them (may fail)
|
||||
pacman -Syu --noconfirm --noprogressbar dtk6core dtk6declarative dtk6systemsettings
|
||||
|
||||
- name: Install DDM dependencies
|
||||
run: |
|
||||
# Try to install DDM from available packages
|
||||
pacman -Syu --noconfirm --noprogressbar ddm
|
||||
|
||||
- name: Build and Install treeland-protocols
|
||||
run: |
|
||||
echo "Building treeland-protocols from source..."
|
||||
git clone https://github.com/linuxdeepin/treeland-protocols.git --depth 1
|
||||
cd treeland-protocols
|
||||
cmake -B build \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build
|
||||
cmake --install build
|
||||
echo "✅ treeland-protocols built and installed from source"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure and Build treeland with ci preset
|
||||
run: |
|
||||
echo "Working directory:" $PWD
|
||||
echo "Configuring treeland with merged waylib and qwlroots code..."
|
||||
cmake --preset ci
|
||||
cmake --build --preset ci
|
||||
echo "✅ treeland built successfully with merged waylib and qwlroots code!"
|
||||
|
||||
- name: Install treeland to staging directory
|
||||
run: |
|
||||
echo "Installing treeland to staging directory..."
|
||||
mkdir -p /tmp/treeland-install
|
||||
DESTDIR=/tmp/treeland-install cmake --install build
|
||||
echo "✅ treeland installed to staging directory"
|
||||
|
||||
echo "Installed files:"
|
||||
find /tmp/treeland-install -type f | head -20
|
||||
echo "Total files installed: $(find /tmp/treeland-install -type f | wc -l)"
|
||||
|
||||
- name: Create treeland installation package
|
||||
run: |
|
||||
cd /tmp/treeland-install
|
||||
|
||||
# Install zip if not available
|
||||
pacman -Syu --noconfirm zip
|
||||
|
||||
# Create package info
|
||||
echo "Creating package info..."
|
||||
cat > PACKAGE_INFO.txt << EOF
|
||||
Package: treeland-archlinux-build
|
||||
Version: $(date +%Y%m%d-%H%M%S)
|
||||
Architecture: x86_64
|
||||
Built-on: Arch Linux
|
||||
Built-with: merged waylib and qwlroots code
|
||||
CMake-Config: -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib
|
||||
|
||||
Installation Instructions:
|
||||
1. Extract this package to /
|
||||
2. Run: sudo ldconfig (if libraries are included)
|
||||
3. Ensure dependencies are installed on target system
|
||||
|
||||
Files included in this package:
|
||||
EOF
|
||||
find . -type f | sort >> PACKAGE_INFO.txt
|
||||
|
||||
# Create the zip package
|
||||
zip -r /tmp/treeland-archlinux-$(date +%Y%m%d-%H%M%S).zip .
|
||||
echo "✅ treeland installation package created"
|
||||
|
||||
ls -la /tmp/treeland-archlinux-*.zip
|
||||
|
||||
- name: Upload treeland ArchLinux build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: treeland-archlinux-build
|
||||
path: "/tmp/treeland-archlinux-*.zip"
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
name: Build waylib on Arch Linux (independent)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'waylib/**'
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/waylib-archlinux-build.yml'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'waylib/**'
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/waylib-archlinux-build.yml'
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
steps:
|
||||
- name: Run in container
|
||||
run: |
|
||||
cat /etc/pacman.d/mirrorlist
|
||||
pacman-key --init
|
||||
pacman --noconfirm --noprogressbar -Syu
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm --noprogressbar base-devel qt6-base qt6-declarative cmake pkgconfig pixman vulkan-headers wlroots0.19 wayland-protocols wlr-protocols git
|
||||
pacman -Syu --noconfirm --noprogressbar clang ninja make
|
||||
pacman -Syu --noconfirm --noprogressbar fakeroot meson sudo
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Create qwlroots symlink for waylib
|
||||
run: |
|
||||
cd waylib
|
||||
ln -sf ../qwlroots qwlroots
|
||||
echo "✅ Created symlink: waylib/qwlroots -> ../qwlroots"
|
||||
ls -la qwlroots
|
||||
|
||||
- name: Configure and Build waylib with ci preset
|
||||
working-directory: waylib
|
||||
run: |
|
||||
echo "Working directory:" $PWD
|
||||
cmake --preset ci -DWITH_SUBMODULE_QWLROOTS=ON
|
||||
cmake --build --preset ci
|
||||
|
||||
- name: Install waylib to staging directory
|
||||
working-directory: waylib
|
||||
run: |
|
||||
echo "Installing waylib to staging directory..."
|
||||
mkdir -p /tmp/waylib-install
|
||||
DESTDIR=/tmp/waylib-install cmake --install build
|
||||
echo "✅ waylib installed to staging directory"
|
||||
|
||||
echo "Installed files:"
|
||||
find /tmp/waylib-install -type f | head -20
|
||||
echo "Total files installed: $(find /tmp/waylib-install -type f | wc -l)"
|
||||
|
||||
- name: Create waylib installation package
|
||||
run: |
|
||||
cd /tmp/waylib-install
|
||||
|
||||
# Install zip if not available
|
||||
pacman -Syu --noconfirm zip
|
||||
|
||||
# Create package info
|
||||
echo "Creating package info..."
|
||||
cat > PACKAGE_INFO.txt << EOF
|
||||
Package: waylib-archlinux-build
|
||||
Version: $(date +%Y%m%d-%H%M%S)
|
||||
Architecture: x86_64
|
||||
Built-on: Arch Linux
|
||||
Built-with: qwlroots submodule enabled
|
||||
CMake-Config: -DWITH_SUBMODULE_QWLROOTS=ON
|
||||
|
||||
Installation Instructions:
|
||||
1. Extract this package to /
|
||||
2. Run: sudo ldconfig (if libraries are included)
|
||||
3. Ensure dependencies are installed on target system
|
||||
|
||||
Files included in this package:
|
||||
EOF
|
||||
find . -type f | sort >> PACKAGE_INFO.txt
|
||||
|
||||
# Create the zip package
|
||||
zip -r /tmp/waylib-archlinux-$(date +%Y%m%d-%H%M%S).zip .
|
||||
echo "✅ waylib installation package created"
|
||||
|
||||
ls -la /tmp/waylib-archlinux-*.zip
|
||||
|
||||
- name: Upload waylib ArchLinux build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: waylib-archlinux-build
|
||||
path: "/tmp/waylib-archlinux-*.zip"
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
name: Build waylib on Debian unstable (independent)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'waylib/**'
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/waylib-debian-build.yml'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'waylib/**'
|
||||
- 'qwlroots/**'
|
||||
- '.github/workflows/waylib-debian-build.yml'
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: debian:unstable
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build qwlroots first
|
||||
working-directory: qwlroots
|
||||
run: |
|
||||
# Configure apt sources for unstable
|
||||
echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list
|
||||
echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y devscripts equivs
|
||||
|
||||
# Add deepin community repository to install wlr-protocols
|
||||
echo "deb [trusted=yes] https://community-packages.deepin.com/beige/ crimson main commercial community" > /etc/apt/sources.list.d/deepin-community.list
|
||||
|
||||
# Update package lists (ignore signature errors for this temporary repo)
|
||||
apt-get update --allow-unauthenticated
|
||||
|
||||
# Install wlr-protocols package directly
|
||||
apt-get install -y --allow-unauthenticated wlr-protocols
|
||||
# Remove deepin repository to avoid system pollution
|
||||
rm -f /etc/apt/sources.list.d/deepin-community.list
|
||||
apt-get update
|
||||
|
||||
# Install other build dependencies for qwlroots
|
||||
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||
|
||||
# Build qwlroots deb package
|
||||
dpkg-buildpackage -uc -us -b
|
||||
echo "✅ qwlroots deb package built successfully!"
|
||||
ls -la ../*.deb
|
||||
|
||||
- name: Install qwlroots deb package
|
||||
run: |
|
||||
# Install the built qwlroots package
|
||||
dpkg -i qwlroots*.deb || apt-get install -f -y
|
||||
echo "✅ qwlroots package installed!"
|
||||
|
||||
- name: Build waylib deb package
|
||||
working-directory: waylib
|
||||
run: |
|
||||
# Install remaining build dependencies for waylib
|
||||
apt-get install -y devscripts equivs
|
||||
|
||||
# Install waylib build dependencies (qwlroots is now available from the installed deb)
|
||||
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||
|
||||
# Build waylib with submodule disabled (use system qwlroots)
|
||||
# Modify debian/rules to disable submodule
|
||||
sed -i 's/-DCMAKE_INSTALL_PREFIX=\/usr/-DCMAKE_INSTALL_PREFIX=\/usr -DWITH_SUBMODULE_QWLROOTS=OFF/' debian/rules
|
||||
echo "Modified debian/rules to disable qwlroots submodule:"
|
||||
cat debian/rules
|
||||
|
||||
dpkg-buildpackage -uc -us -b
|
||||
echo "✅ waylib deb package built successfully!"
|
||||
ls -la ../*.deb
|
||||
|
||||
- name: Upload waylib deb packages as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: waylib-deb-packages
|
||||
path: "*.deb"
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
.vscode/
|
||||
.cache/
|
||||
build*/
|
||||
.qtcreator/
|
||||
|
||||
*.user
|
||||
|
||||
|
|
@ -49,3 +50,7 @@ debian/files
|
|||
debian/*.substvars
|
||||
debian/*.debhelper.log
|
||||
obj-*-linux-gnu/
|
||||
|
||||
# ai
|
||||
.cursor
|
||||
.specstory
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
[submodule "waylib"]
|
||||
path = waylib
|
||||
url = https://github.com/vioken/waylib
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:linuxdeepin:p:treeland:r:f56f82288bfe7a231b1be25f7b0cb008]
|
||||
file_filter = translations/treeland.<lang>.ts
|
||||
source_file = translations/treeland.en_US.ts
|
||||
source_lang = en_US
|
||||
type = QT
|
||||
|
||||
[o:linuxdeepin:p:treeland:r:b675317802ed042606e0660179b6b04f]
|
||||
file_filter = src/plugins/lockscreen/translations/lockscreen.<lang>.ts
|
||||
source_file = src/plugins/lockscreen/translations/lockscreen.en_US.ts
|
||||
source_lang = en_US
|
||||
type = QT
|
||||
|
||||
[o:linuxdeepin:p:treeland:r:7309e9da01b4b7fbf5c2ac9c2a2d23a6]
|
||||
file_filter = src/plugins/multitaskview/translations/multitaskview.<lang>.ts
|
||||
source_file = src/plugins/multitaskview/translations/multitaskview.en_US.ts
|
||||
source_lang = en_US
|
||||
type = QT
|
||||
|
||||
[o:linuxdeepin:p:treeland:r:1eff66bc82bf8f288b9c56e8c724ea20]
|
||||
file_filter = examples/test_set_treeland_wallpaper/translations/wallpaper.<lang>.ts
|
||||
source_file = examples/test_set_treeland_wallpaper/translations/wallpaper.en_US.ts
|
||||
source_lang = en_US
|
||||
type = QT
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
filters:
|
||||
- filter_type: file
|
||||
source_file: translations/treeland.en_US.ts
|
||||
file_format: QT
|
||||
source_language: en_US
|
||||
translation_files_expression: translations/treeland.<lang>.ts
|
||||
- filter_type: file
|
||||
source_file: src/plugins/lockscreen/translations/lockscreen.en_US.ts
|
||||
file_format: QT
|
||||
source_language: en_US
|
||||
translation_files_expression: src/plugins/lockscreen/translations/lockscreen.<lang>.ts
|
||||
- filter_type: file
|
||||
source_file: src/plugins/multitaskview/translations/multitaskview.en_US.ts
|
||||
file_format: QT
|
||||
source_language: en_US
|
||||
translation_files_expression: src/plugins/multitaskview/translations/multitaskview.<lang>.ts
|
||||
- filter_type: file
|
||||
source_file: examples/test_set_treeland_wallpaper/translations/wallpaper.en_US.ts
|
||||
file_format: QT
|
||||
source_language: en_US
|
||||
translation_files_expression: examples/test_set_treeland_wallpaper/translations/wallpaper.<lang>.ts
|
||||
settings:
|
||||
pr_branch_name: transifex_update_<br_unique_id>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.25.0)
|
||||
|
||||
project(Treeland
|
||||
VERSION 0.2.2
|
||||
VERSION 0.7.0
|
||||
LANGUAGES CXX C)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
|
@ -16,10 +16,10 @@ include(FeatureSummary)
|
|||
|
||||
include(cmake/DefineTarget.cmake)
|
||||
|
||||
option(WITH_SUBMODULE_WAYLIB "Use the waylib from git submodule" OFF)
|
||||
option(WITH_SUBMODULE_WAYLIB "Use the waylib from git submodule" ON)
|
||||
add_feature_info(submodule_waylib WITH_SUBMODULE_WAYLIB "Use waylib from submodule")
|
||||
|
||||
option(ADDRESS_SANITIZER "Enable address sanitize" OFF)
|
||||
option(ADDRESS_SANITIZER "Enable address sanitizer" OFF)
|
||||
add_feature_info(ASanSupport ADDRESS_SANITIZER "https://github.com/google/sanitizers/wiki/AddressSanitizer")
|
||||
|
||||
option(BUILD_TREELAND_EXAMPLES "Build clients demo to test treeland" OFF)
|
||||
|
|
@ -31,16 +31,33 @@ if (DISABLE_DDM)
|
|||
add_compile_definitions("DISABLE_DDM")
|
||||
endif()
|
||||
|
||||
# Alternative lock mechanism: Wayland ext-session-lock
|
||||
option(EXT_SESSION_LOCK_V1 "Enable Wayland ext-session-lock support (alternative to DDM)" ON)
|
||||
add_feature_info(ext_session_lock_v1 EXT_SESSION_LOCK_V1 "Enable ext-session-lock-v1 protocol support in Treeland")
|
||||
|
||||
if (EXT_SESSION_LOCK_V1)
|
||||
add_compile_definitions("EXT_SESSION_LOCK_V1")
|
||||
endif()
|
||||
# Heads-up if both are enabled: ext-session-lock is intended as an alternative to DDM
|
||||
if (NOT EXT_SESSION_LOCK_V1 AND DISABLE_DDM)
|
||||
message(WARNING "no ext-session-lock support and no DDM, treeland will not have session locking ability.")
|
||||
endif()
|
||||
|
||||
if (ADDRESS_SANITIZER)
|
||||
add_compile_options(-fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer)
|
||||
add_link_options(-fsanitize=address)
|
||||
endif()
|
||||
# NOTE: Qt keywords conflict with wlroots. but dtksystemsettings still uses it.
|
||||
# add_definitions("-DQT_NO_KEYWORDS")
|
||||
|
||||
# NOTE: Enable Qt logging with context.
|
||||
add_definitions("-DQT_MESSAGELOGCONTEXT")
|
||||
|
||||
set(LOCAL_QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/qt/qml")
|
||||
|
||||
if(WITH_SUBMODULE_WAYLIB)
|
||||
set(WITH_SUBMODULE_QWLROOTS ON)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/waylib/qwlroots/cmake/WaylandScannerHelpers.cmake)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/qwlroots/cmake/WaylandScannerHelpers.cmake)
|
||||
add_subdirectory(waylib)
|
||||
list(APPEND LOCAL_QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/waylib/src/server")
|
||||
else()
|
||||
|
|
@ -53,9 +70,7 @@ set(QML_IMPORT_PATH "${LOCAL_QML_IMPORT_PATH}" CACHE STRING "For LSP" FORCE)
|
|||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Qt6 CONFIG REQUIRED Core DBus Gui Qml Quick QuickControls2 LinguistTools Test QuickTest)
|
||||
|
||||
set(wlr wlroots-0.18)
|
||||
set(WLROOTS_MINIMUM_REQUIRED 0.18.0)
|
||||
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET ${wlr}>=${WLROOTS_MINIMUM_REQUIRED})
|
||||
pkg_check_modules(WLROOTS REQUIRED IMPORTED_TARGET wlroots-0.19)
|
||||
|
||||
qt_standard_project_setup(REQUIRES 6.8)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,13 +12,7 @@
|
|||
"displayName": "Default Config",
|
||||
"description": "Default build using Ninja generator",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"WITH_SUBMODULE_WAYLIB": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
}
|
||||
}
|
||||
"binaryDir": "${sourceDir}/build"
|
||||
},
|
||||
{
|
||||
"name": "clang",
|
||||
|
|
@ -27,41 +21,51 @@
|
|||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"WITH_SUBMODULE_WAYLIB": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
},
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "submodule",
|
||||
"displayName": "use submodule",
|
||||
"description": "Default build using Ninja generator with git submodule",
|
||||
"name": "ci",
|
||||
"displayName": "CI Build Config",
|
||||
"description": "Build configuration with warnings as errors",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"WITH_SUBMODULE_WAYLIB": {
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
}
|
||||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
|
||||
"CMAKE_C_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "submodule-with-clang",
|
||||
"displayName": "use submodule with clang",
|
||||
"description": "Default build using Ninja generator with git submodule",
|
||||
"name": "deb",
|
||||
"displayName": "Debian Package Build Config",
|
||||
"description": "Build configuration for Debian packaging with examples enabled",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"WITH_SUBMODULE_WAYLIB":{
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_C_COMPILER": "clang",
|
||||
"CMAKE_CXX_COMPILER": "clang++"
|
||||
"CMAKE_C_COMPILER": "gcc",
|
||||
"CMAKE_CXX_COMPILER": "g++",
|
||||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
|
||||
"CMAKE_C_FLAGS": "-Wall -Wextra -Werror -Wno-stringop-overflow",
|
||||
"BUILD_TREELAND_EXAMPLES": "ON"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"configurePreset": "default"
|
||||
},
|
||||
{
|
||||
"name": "clang",
|
||||
"configurePreset": "clang"
|
||||
},
|
||||
{
|
||||
"name": "ci",
|
||||
"configurePreset": "ci"
|
||||
},
|
||||
{
|
||||
"name": "deb",
|
||||
"configurePreset": "deb"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
../waylib/LICENSES/HPND.txt
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017, 2018 Drew DeVault
|
||||
Copyright (c) 2014 Jari Vetoniemi
|
||||
Copyright (c) 2023 The wlroots contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
12
README.md
12
README.md
|
|
@ -10,7 +10,7 @@ Core build dependencies:
|
|||
|
||||
- [waylib](https://github.com/vioken/waylib): A Wayland compositor development library based on wlroots and QtQuick
|
||||
- Qt >= 6.8.0
|
||||
- wlroots = 0.18
|
||||
- wlroots = 0.19
|
||||
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols): Private Wayland protocols used by treeland
|
||||
|
||||
Recommended runtime dependencies:
|
||||
|
|
@ -48,6 +48,16 @@ $ sudo apt build-dep . # install build dependencies
|
|||
$ dpkg-buildpackage -uc -us -nc -b # build binary package(s)
|
||||
```
|
||||
|
||||
## GitHub Actions / CI
|
||||
|
||||
This project uses GitHub Actions for continuous integration. The following workflows are configured:
|
||||
|
||||
- **qwlroots builds**: Triggered when `qwlroots/**` files are modified
|
||||
- **waylib builds**: Triggered when `waylib/**` or `qwlroots/**` files are modified (since waylib depends on qwlroots)
|
||||
- **treeland builds**: Main project builds
|
||||
|
||||
The waylib workflows are configured to also trigger when qwlroots code changes, ensuring that waylib builds remain compatible with qwlroots modifications.
|
||||
|
||||
## Getting Involved
|
||||
|
||||
- [Code contribution via GitHub](https://github.com/linuxdeepin/treeland/)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ treeland 是一个基于 wlroots 和 QtQuick 开发的 Wayland 合成器,旨
|
|||
|
||||
- [waylib](https://github.com/vioken/waylib) 整合 wlroots 和 QtQuick 的 Wayland 合成器开发库
|
||||
- Qt >= 6.8.0
|
||||
- wlroots = 0.18
|
||||
- wlroots = 0.19
|
||||
- [treeland-protocols](https://github.com/linuxdeepin/treeland-protocols) treeland 使用的私有 wayland 协议
|
||||
|
||||
推荐的运行时依赖:
|
||||
|
|
@ -47,6 +47,16 @@ $ sudo apt build-dep . # 安装构建依赖
|
|||
$ dpkg-buildpackage -uc -us -nc -b # 构建二进制软件包
|
||||
```
|
||||
|
||||
## GitHub Actions / 持续集成
|
||||
|
||||
本项目使用 GitHub Actions 进行持续集成。配置了以下工作流:
|
||||
|
||||
- **qwlroots 构建**:当 `qwlroots/**` 文件被修改时触发
|
||||
- **waylib 构建**:当 `waylib/**` 或 `qwlroots/**` 文件被修改时触发(因为 waylib 依赖于 qwlroots)
|
||||
- **treeland 构建**:主项目构建
|
||||
|
||||
waylib 工作流配置为在 qwlroots 代码变化时也会触发,确保 waylib 构建与 qwlroots 修改保持兼容。
|
||||
|
||||
## 参与贡献
|
||||
|
||||
- [通过 GitHub 发起代码贡献](https://github.com/linuxdeepin/treeland/)
|
||||
|
|
@ -54,4 +64,4 @@ $ dpkg-buildpackage -uc -us -nc -b # 构建二进制软件包
|
|||
|
||||
## 许可协议
|
||||
|
||||
**Treeland** 使用 Apache-2.0, LGPL-3.0-only, GPL-2.0-only 或 GPL-3.0-only 许可协议进行发布。
|
||||
**Treeland** 使用 Apache-2.0, LGPL-3.0-only, GPL-2.0-only 或 GPL-3.0-only 许可协议进行发布。
|
||||
|
|
|
|||
191
REUSE.toml
191
REUSE.toml
|
|
@ -3,7 +3,7 @@ SPDX-PackageName = "treeland"
|
|||
SPDX-PackageDownloadLocation = "https://github.com/linuxdeepin/treeland"
|
||||
|
||||
[[annotations]]
|
||||
path = [".github/**", ".obs/**.yml", "garnix.yaml"]
|
||||
path = [".github/**", ".obs/**.yml", "garnix.yaml", ".tx/*"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
|
@ -61,3 +61,192 @@ path = ["src/greeter/**.h", "src/greeter/**.cpp"]
|
|||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "GPL-2.0-only"
|
||||
|
||||
[[annotations]]
|
||||
path = ["qwlroots/**"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "Apache-2.0"
|
||||
|
||||
# ===== WAYLIB REUSE Configuration =====
|
||||
# CI and build files for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/.github/**", "waylib/.obs/**.yml", "waylib/renovate.json"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Gitignore and git modules for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/.gitignore", "waylib/.gitmodules"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Project files for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/**.cmake", "waylib/*CMakeLists.txt", "waylib/**.pc.in", "waylib/**cmake.in"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# README for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/README.md", "waylib/README.zh_CN.md"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "JiDe Zhang"
|
||||
SPDX-License-Identifier = "CC-BY-4.0"
|
||||
|
||||
# Nix Develop files for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/**.nix", "waylib/.envrc", "waylib/flake.lock"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Debian package for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/debian/**"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# C++ pch files for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/src/server/pch/pch.hxx"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Core waylib files
|
||||
[[annotations]]
|
||||
path = [
|
||||
"waylib/examples/tinywl/qml.qrc",
|
||||
"waylib/tests/manual/cursor/cursor.qrc",
|
||||
"waylib/src/server/kernel/WBackend",
|
||||
"waylib/src/server/kernel/WCursor",
|
||||
"waylib/src/server/kernel/WInputDevice",
|
||||
"waylib/src/server/kernel/WInputEvent",
|
||||
"waylib/src/server/kernel/WOutput",
|
||||
"waylib/src/server/kernel/WSeat",
|
||||
"waylib/src/server/kernel/WEvent",
|
||||
"waylib/src/server/kernel/WServer",
|
||||
"waylib/src/server/kernel/WServerInterface",
|
||||
"waylib/src/server/kernel/WSurface",
|
||||
"waylib/src/server/kernel/WSurfaceLayout",
|
||||
"waylib/src/server/kernel/WTexture",
|
||||
"waylib/src/server/kernel/WXdgShell",
|
||||
"waylib/src/server/kernel/WXdgSurface",
|
||||
"waylib/src/server/kernel/WLayerSurface",
|
||||
"waylib/src/server/qtquick/WQuickRenderControl",
|
||||
"waylib/src/server/qtquick/WSurfaceItem",
|
||||
"waylib/src/server/utils/WSignalConnector",
|
||||
"waylib/src/server/utils/WThreadUtils",
|
||||
"waylib/src/server/utils/WCursorImage",
|
||||
"waylib/src/server/utils/WWrapPointer",
|
||||
"waylib/tests/main.cpp",
|
||||
"waylib/tests/test.h"
|
||||
]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "JiDe Zhang"
|
||||
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
|
||||
|
||||
# Waylib protocol files
|
||||
[[annotations]]
|
||||
path = [
|
||||
"waylib/src/server/protocols/WCursorShapeManagerV1",
|
||||
"waylib/src/server/protocols/WForeignToplevel",
|
||||
"waylib/src/server/protocols/WInputMethodHelper",
|
||||
"waylib/src/server/protocols/WLayerSurface",
|
||||
"waylib/src/server/protocols/WOutputManagerV1",
|
||||
"waylib/src/server/protocols/WXdgOutput",
|
||||
"waylib/src/server/protocols/WXdgShell",
|
||||
"waylib/src/server/protocols/WXdgSurface",
|
||||
"waylib/src/server/protocols/WLayerShell",
|
||||
"waylib/src/server/protocols/WInputPopupSurface",
|
||||
"waylib/src/server/protocols/WXWayland",
|
||||
"waylib/src/server/protocols/WXWaylandSurface",
|
||||
"waylib/src/server/protocols/WXdgDecorationManager",
|
||||
"waylib/src/server/protocols/WSessionLock",
|
||||
"waylib/src/server/protocols/WSessionLockManager",
|
||||
"waylib/src/server/protocols/WSessionLockSurface"
|
||||
]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "UnionTech Software Technology Co., Ltd."
|
||||
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
|
||||
|
||||
# Misc files for waylib
|
||||
[[annotations]]
|
||||
path = [
|
||||
"waylib/tests/manual/cursor/res/HandCursor.png",
|
||||
"waylib/examples/tinywl/res/xx.jpg"
|
||||
]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Protocol files with HPND license for waylib
|
||||
[[annotations]]
|
||||
path = ["waylib/src/server/protocols/private/text-input-unstable-v2.xml"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "HPND"
|
||||
|
||||
# ===== QWLROOTS REUSE Configuration =====
|
||||
# CI for qwlroots
|
||||
[[annotations]]
|
||||
path = ["qwlroots/.github/**", "qwlroots/.obs/**.yml", "qwlroots/garnix.yaml"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Project files for qwlroots
|
||||
[[annotations]]
|
||||
path = [
|
||||
"qwlroots/**.cmake",
|
||||
"qwlroots/*CMakeLists.txt",
|
||||
"qwlroots/**.pc.in",
|
||||
"qwlroots/**cmake.in",
|
||||
"qwlroots/.gitignore",
|
||||
"qwlroots/.cursorindexingignore",
|
||||
"qwlroots/.cursor/rules/**.mdc",
|
||||
"qwlroots/.gitmodules"
|
||||
]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Simple header files for qwlroots
|
||||
[[annotations]]
|
||||
path = [
|
||||
"qwlroots/**/qwkeyboard.h",
|
||||
"qwlroots/**/qwpointer.h",
|
||||
"qwlroots/**/qwswitch.h",
|
||||
"qwlroots/**/qwtablet.h",
|
||||
"qwlroots/**/qwtabletpad.h",
|
||||
"qwlroots/**/qwtouch.h"
|
||||
]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# README and documentation for qwlroots
|
||||
[[annotations]]
|
||||
path = ["qwlroots/README.md", "qwlroots/README.zh_CN.md", "qwlroots/doc/ai/**.md"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "JiDe Zhang"
|
||||
SPDX-License-Identifier = "CC-BY-4.0"
|
||||
|
||||
# Nix Develop files for qwlroots
|
||||
[[annotations]]
|
||||
path = ["qwlroots/**.nix", "qwlroots/.envrc", "qwlroots/flake.lock"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "None"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
# Debian package for qwlroots
|
||||
[[annotations]]
|
||||
path = ["qwlroots/debian/**"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "2023 rewine <luhongxu@outlook.com>"
|
||||
SPDX-License-Identifier = "Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
# TranslationUtils.cmake
|
||||
# Provides common functions for handling translation files
|
||||
|
||||
function(setup_translations TARGET_NAME TRANSLATION_PREFIX)
|
||||
# Automatically discover all translation files
|
||||
file(GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/translations/${TRANSLATION_PREFIX}.*.ts")
|
||||
|
||||
# Filter out non-translation files (if any)
|
||||
list(FILTER TS_FILES INCLUDE REGEX ".*\\.ts$")
|
||||
|
||||
# Set translation files variable
|
||||
set(TRANSLATED_FILES)
|
||||
|
||||
# Add lupdate target
|
||||
qt_add_lupdate(
|
||||
SOURCE_TARGETS ${TARGET_NAME}
|
||||
TS_FILES ${TS_FILES}
|
||||
NO_GLOBAL_TARGET
|
||||
)
|
||||
|
||||
# Add lrelease target
|
||||
qt_add_lrelease(
|
||||
TS_FILES ${TS_FILES}
|
||||
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
|
||||
)
|
||||
|
||||
# Install translation files
|
||||
install(FILES ${TRANSLATED_FILES} DESTINATION ${TREELAND_COMPONENTS_TRANSLATION_DIR})
|
||||
|
||||
# Set TRANSLATED_FILES variable to parent scope
|
||||
set(TRANSLATED_FILES ${TRANSLATED_FILES} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(setup_main_translations TARGET_NAME)
|
||||
# Automatically discover all main translation files
|
||||
file(GLOB TS_FILES "${CMAKE_SOURCE_DIR}/translations/treeland.*.ts")
|
||||
|
||||
# Filter out non-translation files (if any)
|
||||
list(FILTER TS_FILES INCLUDE REGEX ".*\\.ts$")
|
||||
|
||||
# Set translation files variable
|
||||
set(TRANSLATED_FILES)
|
||||
|
||||
# Add lupdate target
|
||||
qt_add_lupdate(
|
||||
SOURCE_TARGETS ${TARGET_NAME}
|
||||
TS_FILES ${TS_FILES}
|
||||
NO_GLOBAL_TARGET
|
||||
)
|
||||
|
||||
# Add lrelease target
|
||||
qt_add_lrelease(
|
||||
TS_FILES ${TS_FILES}
|
||||
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
|
||||
)
|
||||
|
||||
# Install translation files
|
||||
install(FILES ${TRANSLATED_FILES} DESTINATION ${TREELAND_COMPONENTS_TRANSLATION_DIR})
|
||||
|
||||
# Set TRANSLATED_FILES variable to parent scope
|
||||
set(TRANSLATED_FILES ${TRANSLATED_FILES} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
|
@ -1,14 +1,165 @@
|
|||
treeland (0.5.21.2-test-multi-seat) unstable; urgency=medium
|
||||
treeland (0.7.6) unstable; urgency=medium
|
||||
|
||||
* feat: Add FPS display.
|
||||
* refactor: implement atomic multi-output configuration
|
||||
* fix: occasional crash during recording toplevel
|
||||
* fix: use safeConnect for aboutToBeInvalidated
|
||||
* i18n: Updates for project TreeLand (#601)
|
||||
* refactor: Convert Session to shared_ptr and simplify session
|
||||
lifecycle
|
||||
* chore: Remove unused code & Add document
|
||||
* feat: Manage per-user Wayland/XWayland sessions via Helper::Session
|
||||
* feat: Add per-user XWayland session management
|
||||
* chore: add ASAN environment variables
|
||||
* feat: Expose XWayland surface process ID
|
||||
* chore: change Debian build environment to unstable
|
||||
* refactor: remove branch filter for workflow triggers
|
||||
* fix: fix build when treeland examples are enabled
|
||||
* fix: fix build failure on Arch Linux
|
||||
* fix: Disable minimize / maximize animation for window that doesn't
|
||||
belongs to current user
|
||||
* fix: fix private module inclusion on lower version of Qt
|
||||
* fix: compile errors on Arch for forward declared class
|
||||
* fix: include Qt private modules for Qt 6.11
|
||||
* feat: add real-time FPS display
|
||||
* feat: support start sessions other than treeland
|
||||
* feat: implement ext-session-lock-v1 support
|
||||
* feat(waylib): implement ext-session-lock-v1 protocol support
|
||||
* fix(waylib): Add missing override specifier in wlayersurface
|
||||
* fix(qwlroots): allow server side destruction of qw_session_lock_v1
|
||||
* fix: Delete useless display text in copy mode
|
||||
* fix: enhance output validation in restore copy mode
|
||||
* fix: use separate TreelandConfig for each user
|
||||
* fix: Ensure proper object destruction before app exit
|
||||
* fix: improve resource management for RenderControl
|
||||
* fix: fix heap-use-after-free on exit
|
||||
|
||||
-- Lu YaNing <luyaning@uniontech.com> Tue, 26 Aug 2025 20:52:43 +0800
|
||||
-- rewine <luhongxu@uniontech.com> Thu, 30 Oct 2025 14:04:56 +0800
|
||||
|
||||
treeland (0.5.21.1) unstable; urgency=medium
|
||||
treeland (0.7.3) unstable; urgency=medium
|
||||
|
||||
* feat: Add multi-seat support.
|
||||
* fix: fix WorkspaceSelectionList animation's highlight border size
|
||||
* fix: fix MultitaskView display problem
|
||||
* refactor: reduce cursor-related log verbosity
|
||||
* fix: fix MultitaskView display problem caused by refactoring
|
||||
TreelandConfig
|
||||
* Updates for project TreeLand (#563)
|
||||
|
||||
-- Lu YaNing <luyaning@uniontech.com> Fri, 25 Jul 2025 08:34:28 +0800
|
||||
-- rewine <luhongxu@uniontech.com> Tue, 23 Sep 2025 17:24:35 +0800
|
||||
|
||||
treeland (0.7.2) unstable; urgency=medium
|
||||
|
||||
* fix: crash on startup due to uninitialized m_config pointer
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Fri, 19 Sep 2025 10:06:51 +0800
|
||||
|
||||
treeland (0.7.1) unstable; urgency=medium
|
||||
|
||||
* fix: Fix socket blocking issue in Wayland server connection handling
|
||||
* fix: correct window title visibility condition
|
||||
* fix: Fix client crash when created via security context
|
||||
* feat: add security-context support
|
||||
* fix: Separate DConfig object creation to another thread to avoid
|
||||
blocking
|
||||
* fix: move DBus call to separate thread to avoid blocking
|
||||
* fix: fixing some trivial memory management bugs.
|
||||
* feat(core): Add support for XDG toplevel surface and XDG shell in
|
||||
RootSurfaceContainer
|
||||
* fix: correct refresh rate on multi-monitor
|
||||
* fix: redraw when frame callback list updates
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Thu, 18 Sep 2025 11:46:00 +0800
|
||||
|
||||
treeland (0.7.0) unstable; urgency=medium
|
||||
|
||||
* fix: fix treeland get stuck in lockscreen after crash recovery
|
||||
* fix: occasional crash during stop preview item handling
|
||||
* refactor: improve code robustness
|
||||
* fix: occasional crash when closing x window
|
||||
* fix: resolve brief black screen during standby
|
||||
* chore: remove dde portal screen cast configuration
|
||||
* fix: correct log category and add null check for surface activation
|
||||
* fix: resolve window resize crash during image capture
|
||||
* fix: fix wrong display render issue when switching VT too quickly
|
||||
* Totally disable lockscreen animation when switching TTY to prevent
|
||||
stuck for switching too quickly
|
||||
* feat: Support TTY switching with DDM
|
||||
* Updates for project TreeLand (#515)
|
||||
* feat(waylib): add WBufferDumper utility for dumping buffer contents
|
||||
to image files
|
||||
* refactor: use unified CI build preset with Werror
|
||||
* build: enable -Werror compiler flag
|
||||
* fix: prevent crash during preview item handling (#512)
|
||||
* fix: prevent cursor flicker during screen recording
|
||||
* docs: add comprehensive logging guidelines and update module logging
|
||||
* feat: add centralized logging system and standardize log usage
|
||||
* feat: ssd title bar displays the window title information
|
||||
* fix: maximize/restore icon in the SSD title bar displays incorrectly
|
||||
* fix: resolve multiple compiler warnings
|
||||
* fix(waylib): prevent duplicate signal connections using
|
||||
Qt::UniqueConnection
|
||||
* fix(waylib): prevent crash by safely managing textureChanged
|
||||
connection
|
||||
* fix: use exec to replace process and avoid duplicate logs in
|
||||
treeland.sh
|
||||
* fix(waylib): Occasional crash when moving the cursor
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Fri, 29 Aug 2025 10:23:45 +0800
|
||||
|
||||
treeland (0.6.2) unstable; urgency=medium
|
||||
|
||||
* fix: resolve library versioning and installation path issues
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Mon, 04 Aug 2025 17:42:40 +0800
|
||||
|
||||
treeland (0.6.1) unstable; urgency=medium
|
||||
|
||||
* fix: improve D-Bus connection handling and QML hover visibility
|
||||
* feat: CLI option: switch from --disable-debug-view to --enable-debug-
|
||||
view
|
||||
* fix(waylib): Specify required rendering flags in
|
||||
WSGRenderFootprintNode
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Fri, 01 Aug 2025 13:33:07 +0800
|
||||
|
||||
treeland (0.6.0) unstable; urgency=medium
|
||||
|
||||
* fix: improve image capture error handling and code structure
|
||||
* feat: add foreign toplevel image capture support
|
||||
* feat: add image capture source support
|
||||
* fix: remove unused quit full button and add helper activation
|
||||
* fix: prevent title bar and window buttons from stealing focus
|
||||
* feat: add wl_drm support
|
||||
* feat: create ext-data-control manager
|
||||
* fix: Handle VT switching keys (#469)
|
||||
* feat: add Nix flake support for project configuration
|
||||
* fix: prevent workspace moveSurfaceTo crash on null wrapper
|
||||
* fix: remove redundant submodule options and configs
|
||||
* chore: update nix dependencies and clean up configurations
|
||||
* fix: Scaling animation not shown while return from shutdown page
|
||||
* chore: Force Ninja build during deb packaging
|
||||
* fix: add timeout to protocol tests
|
||||
* feat: Upload build artifacts as zip archives
|
||||
* chore: fix CI and enable independent builds
|
||||
* refactor: merge qwlroots and waylib source code into treeland
|
||||
* chore: Use treeland-specific seatd service
|
||||
* feat: implement ext-foreign-toplevel-list
|
||||
* i18n: Updates for project TreeLand (#440)
|
||||
* chore: remove polkit rules for login1
|
||||
* feat: add support for alpha modifier protocol
|
||||
* fix: cannot export dbus services
|
||||
* Revert "fix: should not maximize when client set maxsize"
|
||||
* Updates for project TreeLand (#431)
|
||||
* fix: Treeland does not exit when logging out of session
|
||||
* fix: cannot use treeland user session mode
|
||||
* fix: add [[maybe_unused]] attribute to unused parameters
|
||||
* chore: improvement fixes the translation configuration
|
||||
* feat: add popup surface container for handling popup windows
|
||||
* chore: configure translation files and update Chinese translations
|
||||
* chore: configure transifex translation files
|
||||
* feat: adapt to wlroots-0.19
|
||||
* refactor: remove jemalloc dependency
|
||||
|
||||
-- rewine <luhongxu@uniontech.com> Thu, 31 Jul 2025 20:40:50 +0800
|
||||
|
||||
treeland (0.5.21) unstable; urgency=medium
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ Priority: optional
|
|||
Maintainer: rewine <luhongxu@deepin.org>
|
||||
Build-Depends: cmake (>= 3.4~),
|
||||
debhelper-compat (= 13),
|
||||
ninja-build,
|
||||
extra-cmake-modules (>= 1.4.0~),
|
||||
libddm-dev,
|
||||
libdtk6core-bin,
|
||||
libdtk6core-dev,
|
||||
libdtk6declarative-dev,
|
||||
libdtk6gui-dev,
|
||||
|
|
@ -12,23 +14,27 @@ Build-Depends: cmake (>= 3.4~),
|
|||
libdtkcommon-dev,
|
||||
libsystemd-dev [linux-any],
|
||||
systemd,
|
||||
libwaylib-dev,
|
||||
libwlroots-0.18-dev,
|
||||
libwlroots-0.19-dev,
|
||||
libpixman-1-dev,
|
||||
libxcb-ewmh-dev,
|
||||
libdrm-dev,
|
||||
pkg-config,
|
||||
qml6-module-qtquick-templates,
|
||||
qt6-base-dev (>= 6.6.1~),
|
||||
qt6-base-private-dev (>= 6.6.1~),
|
||||
qt6-base-dev-tools (>= 6.6.0),
|
||||
qt6-declarative-dev (>= 6.6.1~),
|
||||
qt6-declarative-private-dev (>= 6.6.0),
|
||||
qt6-shadertools-dev,
|
||||
qt6-tools-dev,
|
||||
qt6-tools-dev-tools (>= 6.6.1~),
|
||||
qt6-wayland,
|
||||
qt6-wayland-dev,
|
||||
qt6-wayland-private-dev,
|
||||
qwlroots,
|
||||
wayland-protocols,
|
||||
wlr-protocols,
|
||||
treeland-protocols,
|
||||
libpam0g-dev,
|
||||
libjemalloc-dev,
|
||||
Standards-Version: 4.6.0
|
||||
Section: dde
|
||||
Homepage: https://github.com/linuxdeepin/treeland.git
|
||||
|
|
@ -45,6 +51,9 @@ Depends: qml6-module-qtquick-layouts,
|
|||
treeland-data (= ${source:Version}),
|
||||
xwayland,
|
||||
${shlibs:Depends},
|
||||
Conflicts: libwaylib, qwlroots
|
||||
Replaces: libwaylib, qwlroots
|
||||
Recommends: ddm,
|
||||
Description: a Wayland compositor based on wlroots and QML, designed with an attractive and elegant appearance.
|
||||
|
||||
Package: treeland-dev
|
||||
|
|
@ -52,6 +61,8 @@ Section: libdevel
|
|||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${misc:Depends}, treeland( =${source:Version}),
|
||||
Conflicts: libwaylib-dev, qwlroots
|
||||
Replaces: libwaylib-dev, qwlroots
|
||||
Description: a Wayland compositor based on wlroots and QML, designed with an attractive and elegant appearance.
|
||||
|
||||
Package: treeland-examples
|
||||
|
|
|
|||
|
|
@ -8,14 +8,12 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|||
|
||||
# see ENVIRONMENT in dpkg-buildflags(1)
|
||||
# package maintainers to append CFLAGS
|
||||
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
# export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
# package maintainers to append LDFLAGS
|
||||
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
TREELAND_CMAKE_ARGS = -DBUILD_TREELAND_EXAMPLES=ON
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- ${TREELAND_CMAKE_ARGS}
|
||||
dh_auto_configure -- --preset deb
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
usr/share/dsg/configs/*
|
||||
usr/share/treeland/shortcuts/*
|
||||
usr/share/wayland-sessions/treeland.desktop
|
||||
etc/xdg-desktop-portal/dde-portals.conf
|
||||
|
|
|
|||
|
|
@ -1,2 +1,5 @@
|
|||
usr/include/*
|
||||
usr/lib/*/cmake/*
|
||||
usr/lib/*/cmake/*
|
||||
usr/lib/*/pkgconfig/*
|
||||
usr/lib/*/lib*.so
|
||||
usr/lib/*/lib*.a
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
usr/share/wayland-sessions/treeland-user.desktop
|
||||
usr/bin/treeland-user-wrapper
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ usr/lib/systemd/system/*
|
|||
usr/libexec/*
|
||||
usr/share/*/translations/*
|
||||
usr/share/dbus-1/system.d/*
|
||||
usr/share/polkit-1/rules.d/*
|
||||
usr/lib/*/lib*
|
||||
usr/lib/*/lib*.so.*
|
||||
usr/lib/*/treeland/plugins/lib*.so
|
||||
usr/share/treeland/qml
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
nix-filter,
|
||||
ddm,
|
||||
treeland-protocols,
|
||||
}:
|
||||
rec {
|
||||
qwlroots = pkgs.qt6Packages.callPackage ./qwlroots/nix {
|
||||
inherit nix-filter;
|
||||
wlroots = pkgs.wlroots_0_19;
|
||||
};
|
||||
|
||||
waylib = pkgs.qt6Packages.callPackage ./waylib/nix {
|
||||
inherit nix-filter qwlroots;
|
||||
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
|
||||
};
|
||||
|
||||
treeland = pkgs.qt6Packages.callPackage ./nix {
|
||||
inherit
|
||||
nix-filter
|
||||
ddm
|
||||
treeland-protocols
|
||||
qwlroots
|
||||
waylib
|
||||
;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Logging Guidelines for Treeland Project
|
||||
|
||||
This document provides guidelines for logging in the Treeland project, covering both treeland and waylib modules.
|
||||
|
||||
## Overview
|
||||
|
||||
The Treeland project uses Qt's logging system with customized categories. There are two different approaches for treeland and waylib modules:
|
||||
|
||||
- **treeland**: Uses centralized logging categories defined in `treelandlogging.h/.cpp`
|
||||
- **waylib**: Uses local logging category definitions in each file
|
||||
|
||||
## Logging Categories
|
||||
|
||||
### Treeland Module Categories
|
||||
|
||||
All logging categories for the treeland module are centrally defined in `src/common/treelandlogging.h`:
|
||||
|
||||
```cpp
|
||||
// Core functionality
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandCore)
|
||||
// Input device handling
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandInput)
|
||||
// Output/display management
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandOutput)
|
||||
// Plugin system
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandPlugin)
|
||||
// And more...
|
||||
```
|
||||
|
||||
### Waylib Module Categories
|
||||
|
||||
Waylib modules define their categories locally in each file. The category naming follows this pattern:
|
||||
`waylib.<module>.<component>[.<subcomponent>]`
|
||||
|
||||
Example from wcursor.cpp:
|
||||
|
||||
```cpp
|
||||
// Cursor management and movement
|
||||
Q_LOGGING_CATEGORY(waylibCursor, "waylib.server.cursor", QtInfoMsg)
|
||||
// Cursor input events
|
||||
Q_LOGGING_CATEGORY(waylibCursorInput, "waylib.server.cursor.input", QtDebugMsg)
|
||||
// Cursor gesture events
|
||||
Q_LOGGING_CATEGORY(waylibCursorGesture, "waylib.server.cursor.gesture", QtDebugMsg)
|
||||
```
|
||||
|
||||
## Log Levels
|
||||
|
||||
Use appropriate log levels based on the message importance:
|
||||
|
||||
- **Debug (qCDebug)**: Detailed information for debugging
|
||||
- **Info (qCInfo)**: General operational information
|
||||
- **Warning (qCWarning)**: Potentially harmful situations
|
||||
- **Critical (qCCritical)**: Critical errors that need immediate attention
|
||||
|
||||
Example:
|
||||
```cpp
|
||||
qCDebug(waylibCursor) << "Processing cursor motion at" << position;
|
||||
qCWarning(waylibCursorInput) << "Invalid button code:" << code;
|
||||
qCCritical(treelandCore) << "Failed to initialize core component";
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Clear and Contextual Messages**
|
||||
- Include relevant context in log messages
|
||||
```cpp
|
||||
// Good
|
||||
qCDebug(waylibCursor) << "Cursor moved from" << oldPos << "to" << newPos;
|
||||
|
||||
// Bad
|
||||
qCDebug(waylibCursor) << "Cursor moved";
|
||||
```
|
||||
|
||||
2. **Appropriate Log Levels**
|
||||
- Debug: Development and troubleshooting
|
||||
- Info: Normal operations
|
||||
- Warning: Unexpected but recoverable
|
||||
- Critical: Serious errors
|
||||
|
||||
3. **Category Organization**
|
||||
- Use specific categories for better filtering
|
||||
```cpp
|
||||
// Instead of
|
||||
qCDebug(waylibCursor) << "Touch event received";
|
||||
|
||||
// Use
|
||||
qCDebug(waylibCursorTouch) << "Touch event received";
|
||||
```
|
||||
|
||||
4. **State Changes**
|
||||
- Log important state changes with before/after values
|
||||
```cpp
|
||||
qCDebug(waylibCursor) << "Visibility changed from" << oldVisible << "to" << newVisible;
|
||||
```
|
||||
|
||||
5. **Error Handling**
|
||||
- Include error details and potential impact
|
||||
```cpp
|
||||
qCWarning(waylibCursor) << "Failed to attach device" << device->name()
|
||||
<< "- not a pointing device";
|
||||
```
|
||||
|
||||
## Implementation Examples
|
||||
|
||||
### Treeland Module
|
||||
|
||||
```cpp
|
||||
#include "treelandlogging.h"
|
||||
|
||||
void ExampleClass::processEvent()
|
||||
{
|
||||
qCDebug(treelandCore) << "Processing event:" << eventType;
|
||||
if (error) {
|
||||
qCWarning(treelandCore) << "Event processing failed:" << errorDetails;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Waylib Module
|
||||
|
||||
```cpp
|
||||
// Local category definition
|
||||
Q_LOGGING_CATEGORY(waylibExample, "waylib.module.example", QtInfoMsg)
|
||||
|
||||
void ExampleClass::processEvent()
|
||||
{
|
||||
qCDebug(waylibExample) << "Processing event:" << eventType;
|
||||
if (error) {
|
||||
qCWarning(waylibExample) << "Event processing failed:" << errorDetails;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Debugging Tips
|
||||
|
||||
1. **Enable/Disable Categories**
|
||||
```bash
|
||||
export QT_LOGGING_RULES="waylib.server.cursor.debug=true"
|
||||
export QT_LOGGING_RULES="waylib.*.debug=false"
|
||||
```
|
||||
|
||||
2. **Log to File**
|
||||
```bash
|
||||
export QT_LOGGING_TO_FILE=1
|
||||
export QT_LOGGING_OUTPUT=/path/to/logfile.txt
|
||||
```
|
||||
|
||||
## Common Mistakes to Avoid
|
||||
|
||||
1. **Don't expose sensitive information**
|
||||
```cpp
|
||||
// Bad
|
||||
qCDebug(treelandCore) << "User password:" << password;
|
||||
```
|
||||
|
||||
2. **Don't mix categories inappropriately**
|
||||
```cpp
|
||||
// Bad
|
||||
qCDebug(treelandInput) << "Cursor position changed"; // Should use cursor category
|
||||
```
|
||||
|
||||
3. **Don't overuse Critical level**
|
||||
```cpp
|
||||
// Bad
|
||||
qCCritical(waylibCursor) << "Minor position adjustment failed";
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
When contributing to the project:
|
||||
|
||||
1. Follow the established category naming patterns
|
||||
2. Use appropriate log levels
|
||||
3. Provide clear and contextual messages
|
||||
4. Add new categories through proper channels (centralized for treeland, local for waylib)
|
||||
|
||||
For questions about logging, please refer to this guide or contact the maintainers.
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
# Treeland 项目日志指南
|
||||
|
||||
本文档提供了 Treeland 项目的日志指南,涵盖了 treeland 和 waylib 模块。
|
||||
|
||||
## 概述
|
||||
|
||||
Treeland 项目使用 Qt 的日志系统并自定义了日志类别。treeland 和 waylib 模块采用了两种不同的方式:
|
||||
|
||||
- **treeland**:使用在 `treelandlogging.h/.cpp` 中集中定义的日志类别
|
||||
- **waylib**:在各个文件中本地定义日志类别
|
||||
|
||||
## 日志类别
|
||||
|
||||
### Treeland 模块类别
|
||||
|
||||
所有 treeland 模块的日志类别都集中定义在 `src/common/treelandlogging.h` 中:
|
||||
|
||||
```cpp
|
||||
// 核心功能
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandCore)
|
||||
// 输入设备处理
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandInput)
|
||||
// 输出/显示管理
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandOutput)
|
||||
// 插件系统
|
||||
Q_DECLARE_LOGGING_CATEGORY(treelandPlugin)
|
||||
// 更多...
|
||||
```
|
||||
|
||||
### Waylib 模块类别
|
||||
|
||||
Waylib 模块在各自的文件中定义类别。类别命名遵循以下模式:
|
||||
`waylib.<模块>.<组件>[.<子组件>]`
|
||||
|
||||
来自 wcursor.cpp 的示例:
|
||||
|
||||
```cpp
|
||||
// 光标管理和移动
|
||||
Q_LOGGING_CATEGORY(waylibCursor, "waylib.server.cursor", QtInfoMsg)
|
||||
// 光标输入事件
|
||||
Q_LOGGING_CATEGORY(waylibCursorInput, "waylib.server.cursor.input", QtDebugMsg)
|
||||
// 光标手势事件
|
||||
Q_LOGGING_CATEGORY(waylibCursorGesture, "waylib.server.cursor.gesture", QtDebugMsg)
|
||||
```
|
||||
|
||||
## 日志级别
|
||||
|
||||
根据消息的重要性使用适当的日志级别:
|
||||
|
||||
- **Debug (qCDebug)**:调试信息,用于开发调试
|
||||
- **Info (qCInfo)**:一般操作信息
|
||||
- **Warning (qCWarning)**:潜在的有害情况
|
||||
- **Critical (qCCritical)**:需要立即关注的严重错误
|
||||
|
||||
示例:
|
||||
```cpp
|
||||
qCDebug(waylibCursor) << "正在处理光标移动,位置:" << position;
|
||||
qCWarning(waylibCursorInput) << "无效的按钮代码:" << code;
|
||||
qCCritical(treelandCore) << "核心组件初始化失败";
|
||||
```
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **清晰和上下文相关的消息**
|
||||
- 在日志消息中包含相关上下文
|
||||
```cpp
|
||||
// 好的做法
|
||||
qCDebug(waylibCursor) << "光标从" << oldPos << "移动到" << newPos;
|
||||
|
||||
// 不好的做法
|
||||
qCDebug(waylibCursor) << "光标移动";
|
||||
```
|
||||
|
||||
2. **适当的日志级别**
|
||||
- Debug:开发和故障排除
|
||||
- Info:正常操作
|
||||
- Warning:意外但可恢复的情况
|
||||
- Critical:严重错误
|
||||
|
||||
3. **类别组织**
|
||||
- 使用特定类别以便更好地过滤
|
||||
```cpp
|
||||
// 不要这样
|
||||
qCDebug(waylibCursor) << "收到触摸事件";
|
||||
|
||||
// 应该这样
|
||||
qCDebug(waylibCursorTouch) << "收到触摸事件";
|
||||
```
|
||||
|
||||
4. **状态变化**
|
||||
- 记录重要的状态变化,包含前后的值
|
||||
```cpp
|
||||
qCDebug(waylibCursor) << "可见性从" << oldVisible << "变更为" << newVisible;
|
||||
```
|
||||
|
||||
5. **错误处理**
|
||||
- 包含错误详情和潜在影响
|
||||
```cpp
|
||||
qCWarning(waylibCursor) << "设备" << device->name()
|
||||
<< "附加失败 - 不是指针设备";
|
||||
```
|
||||
|
||||
## 实现示例
|
||||
|
||||
### Treeland 模块
|
||||
|
||||
```cpp
|
||||
#include "treelandlogging.h"
|
||||
|
||||
void ExampleClass::processEvent()
|
||||
{
|
||||
qCDebug(treelandCore) << "正在处理事件:" << eventType;
|
||||
if (error) {
|
||||
qCWarning(treelandCore) << "事件处理失败:" << errorDetails;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Waylib 模块
|
||||
|
||||
```cpp
|
||||
// 本地类别定义
|
||||
Q_LOGGING_CATEGORY(waylibExample, "waylib.module.example", QtInfoMsg)
|
||||
|
||||
void ExampleClass::processEvent()
|
||||
{
|
||||
qCDebug(waylibExample) << "正在处理事件:" << eventType;
|
||||
if (error) {
|
||||
qCWarning(waylibExample) << "事件处理失败:" << errorDetails;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 调试技巧
|
||||
|
||||
1. **启用/禁用类别**
|
||||
```bash
|
||||
export QT_LOGGING_RULES="waylib.server.cursor.debug=true"
|
||||
export QT_LOGGING_RULES="waylib.*.debug=false"
|
||||
```
|
||||
|
||||
2. **日志输出到文件**
|
||||
```bash
|
||||
export QT_LOGGING_TO_FILE=1
|
||||
export QT_LOGGING_OUTPUT=/path/to/logfile.txt
|
||||
```
|
||||
|
||||
## 常见错误避免
|
||||
|
||||
1. **不要暴露敏感信息**
|
||||
```cpp
|
||||
// 错误
|
||||
qCDebug(treelandCore) << "用户密码:" << password;
|
||||
```
|
||||
|
||||
2. **不要混用类别**
|
||||
```cpp
|
||||
// 错误
|
||||
qCDebug(treelandInput) << "光标位置改变"; // 应该使用光标类别
|
||||
```
|
||||
|
||||
3. **不要过度使用 Critical 级别**
|
||||
```cpp
|
||||
// 错误
|
||||
qCCritical(waylibCursor) << "轻微的位置调整失败";
|
||||
```
|
||||
|
||||
## 贡献指南
|
||||
|
||||
在为项目贡献代码时:
|
||||
|
||||
1. 遵循既定的类别命名模式
|
||||
2. 使用适当的日志级别
|
||||
3. 提供清晰和上下文相关的消息
|
||||
4. 通过正确的方式添加新类别(treeland 集中定义,waylib 本地定义)
|
||||
|
||||
如有关于日志的问题,请参考本指南或联系维护者。
|
||||
|
|
@ -274,7 +274,7 @@ void TreelandCaptureManager::setRecord(bool newRecord)
|
|||
if (m_record == newRecord)
|
||||
return;
|
||||
m_record = newRecord;
|
||||
emit recordChanged();
|
||||
Q_EMIT recordChanged();
|
||||
}
|
||||
|
||||
bool TreelandCaptureManager::recordStarted() const
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
|
|||
QObject::connect(&engine,
|
||||
&QQmlApplicationEngine::objectCreated,
|
||||
manager,
|
||||
[&app, manager, captureWithMask](QObject *object, const QUrl &url) {
|
||||
[&app, manager, captureWithMask](QObject *object, const QUrl &) {
|
||||
if (auto canvasWindow = qobject_cast<QQuickWindow *>(object)) {
|
||||
auto waylandWindow = static_cast<QtWaylandClient::QWaylandWindow *>(
|
||||
canvasWindow->handle());
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ void Player::setCaptureContext(TreelandCaptureContext *context)
|
|||
Q_EMIT captureContextChanged();
|
||||
}
|
||||
|
||||
QSGNode *Player::updatePaintNode(QSGNode *old, UpdatePaintNodeData *data)
|
||||
QSGNode *Player::updatePaintNode(QSGNode *old, [[maybe_unused]] UpdatePaintNodeData *data)
|
||||
{
|
||||
ensureDebugLogger();
|
||||
if (!m_captureContext || !m_captureContext->session()
|
||||
|
|
@ -119,7 +119,7 @@ static const char *eglGetErrorString(EGLint error)
|
|||
}
|
||||
}
|
||||
|
||||
static const char *drmFormatString(int fourcc)
|
||||
[[maybe_unused]] static const char *drmFormatString(int fourcc)
|
||||
{
|
||||
switch (fourcc) {
|
||||
CASE_STR(DRM_FORMAT_R8)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class SubWindow : public QQuickWindow
|
|||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
Q_PROPERTY(QQuickWindow *parent READ parent WRITE setParent NOTIFY parentChanged FINAL)
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void parentChanged();
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||
if (!seat)
|
||||
qFatal("Failed to get wl_seat from QtWayland QPA!");
|
||||
|
||||
TreelandDDEActiveV1 *active =
|
||||
[[maybe_unused]] TreelandDDEActiveV1 *active =
|
||||
new TreelandDDEActiveV1(manager->get_treeland_dde_active(seat));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
find_package(Qt6 REQUIRED COMPONENTS WaylandClient Quick)
|
||||
find_package(Qt6 COMPONENTS WaylandClientPrivate QUIET)
|
||||
find_package(TreelandProtocols REQUIRED)
|
||||
|
||||
set(BIN_NAME test-multitaskview)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
QQmlApplicationEngine engine;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
const QUrl url(u"qrc:/qt/qml/pinchhandler/Main.qml"_qs);
|
||||
using namespace Qt::StringLiterals;
|
||||
const QUrl url(u"qrc:/qt/qml/pinchhandler/Main.qml"_s);
|
||||
#else
|
||||
const QUrl url(u"qrc:/pinchhandler/Main.qml"_qs);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ find_package(TreelandProtocols REQUIRED)
|
|||
find_package(PkgConfig REQUIRED)
|
||||
pkg_get_variable(WAYLAND_PROTOCOLS wayland-protocols pkgdatadir)
|
||||
|
||||
# Include translation utilities
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/TranslationUtils.cmake)
|
||||
|
||||
set(BIN_NAME test-set-treeland-wallpaper)
|
||||
|
||||
qt_add_executable(${BIN_NAME}
|
||||
|
|
@ -36,24 +39,8 @@ qt_add_qml_module(${BIN_NAME}
|
|||
SOURCES imagehelper.h imagehelper.cpp
|
||||
)
|
||||
|
||||
set(TRANSLATED_FILES)
|
||||
|
||||
qt_add_lupdate(
|
||||
SOURCE_TARGETS ${BIN_NAME}
|
||||
TS_FILES
|
||||
translations/wallpaper.zh_CN.ts
|
||||
translations/wallpaper.en_US.ts
|
||||
NO_GLOBAL_TARGET
|
||||
)
|
||||
|
||||
qt_add_lrelease(
|
||||
TS_FILES
|
||||
translations/wallpaper.zh_CN.ts
|
||||
translations/wallpaper.en_US.ts
|
||||
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
|
||||
)
|
||||
|
||||
install(FILES ${TRANSLATED_FILES} DESTINATION ${TREELAND_COMPONENTS_TRANSLATION_DIR})
|
||||
# Use translation utilities to setup translations
|
||||
setup_translations(${BIN_NAME} wallpaper)
|
||||
|
||||
target_link_libraries(${BIN_NAME}
|
||||
PRIVATE
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ca">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Imatge local</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Mostra-ho tot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Imatge del sistema</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Fons de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Fons actual</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Mètode de visualització del fons de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Estira</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Preserva'n l'aspecte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Si us plau, trieu un fitxer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Afegiu-hi un fons de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Afegiu-hi un directori</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Paràmetres del fons de pantalla</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="es">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Imagen local</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Mostrar todo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Imagen del sistema</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Fondo de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Fondo de pantalla actual</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Modo de visualización de fondo de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Estirar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Conservar aspecto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Seleccione un archivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Agregar fondo de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Agregar directorio</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Configuración del fondo de pantalla</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="fi">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Valokuva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Näytä kaikki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Valokuva</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Taustakuva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Nykyinen taustakuva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Taustakuvan näyttötapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Venytetty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Säilytä kuvasuhde</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Valitse tiedosto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Lisää taustakuva</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Lisää kansio</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Taustakuvan asetukset</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="fr">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Image locale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Afficher tout</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Image système</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Fond d'écran</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Fond d'écran actuel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Méthode d'affichage du fond d'écran</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Étirement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Conserver l'aspect</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Veuillez choisir un fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Ajouter un fond d'écran</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Ajouter un répertoire</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Paramètres du fond d'écran</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ja">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>ローカルの画像</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>すべて表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>システムの画像</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>壁紙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>現在の壁紙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>壁紙の表示方法</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>拡大する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>アスペクト比を維持する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>ファイルを選択してください</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>壁紙を追加</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>ディレクトリを追加</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>壁紙の設定</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="pl">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Zdjęcie lokalne</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Pokaż wszystkie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Zdjęcie systemowe</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Tapeta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Bieżąca tapeta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Wyświetlanie tapety</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Rozciągnij</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Dopasuj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Wybierz plik</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Dodaj tapetę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Dodaj katalog</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Ustawienia tapety</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="pt_BR">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Imagem local</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Mostrar tudo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Imagem do sistema</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Papel de parede</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Papel de parede atual</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Método de exibição de papel de parede</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Esticado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Preservar o ajuste do aspecto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Por favor escolha um arquivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Adicionar papel de parede</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Adicionar diretório</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Configurações de papel de parede</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ru">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Показать все</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Обои</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Текущие обои</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Метод отображения обоев</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Пожалуйста, выберите файл</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Добавить обои</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Добавить папку</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Настройки обоев</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="sq">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Foto Vendore</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Shfaqi Krejt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Foto Sistemi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Sfond</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Sfond i Tanishëm</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Metodë Shfaqjeje Sfondi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Shformoje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation type="unfinished"/>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Ju lutemi, zgjidhni një kartelë</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Shtoni Sfond</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Shtoni Drejtori</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Rregullime Sfondi</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="uk">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="48"/>
|
||||
<source>Local Picture</source>
|
||||
<translation>Локальне зображення</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="49"/>
|
||||
<location filename="../Wallpaper.qml" line="62"/>
|
||||
<source>Show All</source>
|
||||
<translation>Показати все</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../Wallpaper.qml" line="61"/>
|
||||
<source>System Picture</source>
|
||||
<translation>Загальносистемне зображення</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="29"/>
|
||||
<source>Wallpaper</source>
|
||||
<translation>Фонове зображення</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="83"/>
|
||||
<source>Current Wallpaepr</source>
|
||||
<translation>Поточне фонове зображення</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="93"/>
|
||||
<source>Wallpaper Display Method</source>
|
||||
<translation>Спосіб показу фонового зображення</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="100"/>
|
||||
<source>Stretch</source>
|
||||
<translation>Розтягнути</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="101"/>
|
||||
<source>Preserve Aspect Fit</source>
|
||||
<translation>Зберегти співвідношення розмірів</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation>Будь ласка, виберіть файл</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
<source>Add Wallpaper</source>
|
||||
<translation>Додати фонове зображення</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation>Додати каталог</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main</name>
|
||||
<message>
|
||||
<location filename="../main.qml" line="14"/>
|
||||
<source>Wallpaper Settings</source>
|
||||
<translation>Параметри фонових зображень</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="zh_CN">
|
||||
<context>
|
||||
<name>Wallpaper</name>
|
||||
<message>
|
||||
|
|
@ -19,10 +17,6 @@
|
|||
<source>System Picture</source>
|
||||
<translation>系统壁纸</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show All </source>
|
||||
<translation type="vanished">全部显示</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WallpaperSetting</name>
|
||||
|
|
@ -54,7 +48,7 @@
|
|||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="111"/>
|
||||
<source>Please choose a file</source>
|
||||
<translation type="unfinished">请选择文件</translation>
|
||||
<translation>请选择文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="126"/>
|
||||
|
|
@ -64,7 +58,7 @@
|
|||
<message>
|
||||
<location filename="../WallpaperSetting.qml" line="135"/>
|
||||
<source>Add Directory</source>
|
||||
<translation type="unfinished">添加目录</translation>
|
||||
<translation>添加目录</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
@ -75,4 +69,4 @@
|
|||
<translation>壁纸设置</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
</TS>
|
||||
|
|
@ -11,10 +11,10 @@ DDEShelSurfaceWindow::DDEShelSurfaceWindow(TestMode mode, QWidget *parent)
|
|||
: QWidget{ parent }
|
||||
, m_mode(mode)
|
||||
{
|
||||
QLineEdit *l = new QLineEdit(this);
|
||||
[[maybe_unused]] QLineEdit *l = new QLineEdit(this);
|
||||
}
|
||||
|
||||
void DDEShelSurfaceWindow::showEvent(QShowEvent *event)
|
||||
void DDEShelSurfaceWindow::showEvent([[maybe_unused]] QShowEvent *event)
|
||||
{
|
||||
if (isVisible()) {
|
||||
apply();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class VirtualOutputManager
|
|||
public:
|
||||
explicit VirtualOutputManager();
|
||||
|
||||
void virtual_output_manager_v1_virtual_output_list(wl_array *names) { }
|
||||
void virtual_output_manager_v1_virtual_output_list([[maybe_unused]] wl_array *names) { }
|
||||
};
|
||||
|
||||
VirtualOutputManager::VirtualOutputManager()
|
||||
|
|
@ -36,7 +36,7 @@ class VirtualOutput
|
|||
public:
|
||||
explicit VirtualOutput(struct ::treeland_virtual_output_v1 *object);
|
||||
|
||||
void virtual_output_v1_outputs(const QString &name, wl_array *outputs)
|
||||
void virtual_output_v1_outputs(const QString &name, [[maybe_unused]] wl_array *outputs)
|
||||
{
|
||||
qInfo() << "Screen group name: " << name;
|
||||
}
|
||||
|
|
|
|||
71
flake.lock
71
flake.lock
|
|
@ -13,11 +13,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737432823,
|
||||
"narHash": "sha256-pty5k1MQ9Fh68dscINllJ3Df3mzUgcB0HgBGFvw1Xgs=",
|
||||
"lastModified": 1753066592,
|
||||
"narHash": "sha256-jtFBL0yT1fBwatqvRuCvp0LjKOChU4YGmZvMpIIrAmE=",
|
||||
"owner": "linuxdeepin",
|
||||
"repo": "ddm",
|
||||
"rev": "4cfcaf4184a47780b248ea9a43e38563ae0d55ab",
|
||||
"rev": "e3a27b23cefe51adbfab973043b26959136ea4ad",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -61,11 +61,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1739866667,
|
||||
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
||||
"lastModified": 1752950548,
|
||||
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
|
||||
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -75,41 +75,13 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"qwlroots": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nix-filter": [
|
||||
"nix-filter"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739876530,
|
||||
"narHash": "sha256-nYLzX1MJ8/R5lSc/m0I/BnjXLjyJWQd4t1ucUfQvmJY=",
|
||||
"owner": "vioken",
|
||||
"repo": "qwlroots",
|
||||
"rev": "6e2ec4e6d7dce46232a11dd1f12adf5f6106f41b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vioken",
|
||||
"repo": "qwlroots",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"ddm": "ddm",
|
||||
"flake-utils": "flake-utils",
|
||||
"nix-filter": "nix-filter",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"qwlroots": "qwlroots",
|
||||
"treeland-protocols": "treeland-protocols",
|
||||
"waylib": "waylib"
|
||||
"treeland-protocols": "treeland-protocols"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
|
@ -152,35 +124,6 @@
|
|||
"repo": "treeland-protocols",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"waylib": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nix-filter": [
|
||||
"nix-filter"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"qwlroots": [
|
||||
"qwlroots"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1740038587,
|
||||
"narHash": "sha256-oPeJh/0jSWEk07p8MjkNj1N73VXHDvX5LKZ7vdJP9zs=",
|
||||
"owner": "vioken",
|
||||
"repo": "waylib",
|
||||
"rev": "327cfe62d681ff188c6b3177120146c047128bb6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vioken",
|
||||
"repo": "waylib",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
|
|||
86
flake.nix
86
flake.nix
|
|
@ -5,19 +5,6 @@
|
|||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nix-filter.url = "github:numtide/nix-filter";
|
||||
qwlroots = {
|
||||
url = "github:vioken/qwlroots";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.nix-filter.follows = "nix-filter";
|
||||
};
|
||||
waylib = {
|
||||
url = "github:vioken/waylib";
|
||||
inputs.qwlroots.follows = "qwlroots";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
inputs.nix-filter.follows = "nix-filter";
|
||||
};
|
||||
ddm = {
|
||||
url = "github:linuxdeepin/ddm";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -32,49 +19,19 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, nix-filter, waylib, ddm, qwlroots, treeland-protocols }@input:
|
||||
outputs = { self, nixpkgs, flake-utils, nix-filter, ddm, treeland-protocols }@input:
|
||||
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" "riscv64-linux" ]
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
treeland = pkgs.qt6Packages.callPackage ./nix {
|
||||
nix-filter = nix-filter.lib;
|
||||
qwlroots = qwlroots.packages.${system}.default;
|
||||
waylib = waylib.packages.${system}.default.override {
|
||||
debug = false;
|
||||
};
|
||||
ddm = ddm.packages.${system}.default;
|
||||
treeland-protocols = treeland-protocols.packages.${system}.default;
|
||||
};
|
||||
in
|
||||
{
|
||||
rec {
|
||||
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
{
|
||||
imports = [ "${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix" ];
|
||||
|
||||
# TODO: allow set Environment in services.seatd
|
||||
users.groups.seat = { };
|
||||
systemd.services.seatd = {
|
||||
description = "Seat management daemon";
|
||||
documentation = [ "man:seatd(1)" ];
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
restartIfChanged = false;
|
||||
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
NotifyAccess = "all";
|
||||
SyslogIdentifier = "seatd";
|
||||
ExecStart = "${pkgs.sdnotify-wrapper}/bin/sdnotify-wrapper ${pkgs.seatd.bin}/bin/seatd -n 1 -u dde -g dde -l debug";
|
||||
RestartSec = 1;
|
||||
Restart = "always";
|
||||
Environment = "SEATD_VTBOUND=0";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
foot
|
||||
gdb
|
||||
|
|
@ -200,10 +157,16 @@
|
|||
];
|
||||
};
|
||||
|
||||
packages = {
|
||||
default = treeland;
|
||||
qemu = self.nixosConfigurations.${system}.vm.config.system.build.vm;
|
||||
};
|
||||
|
||||
packages = (import ./default.nix {
|
||||
inherit pkgs nix-filter;
|
||||
ddm = ddm.packages.${system}.default;
|
||||
treeland-protocols = treeland-protocols.packages.${system}.default;
|
||||
}) // {
|
||||
qemu = self.nixosConfigurations.${system}.vm.config.system.build.vm;
|
||||
};
|
||||
|
||||
treeland = packages.default;
|
||||
|
||||
apps.qemu = {
|
||||
type = "app";
|
||||
|
|
@ -212,14 +175,27 @@
|
|||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
# For submodule build
|
||||
libinput
|
||||
# For submodule waylib and qwlroots
|
||||
wayland
|
||||
wlroots
|
||||
wayland-protocols
|
||||
wlr-protocols
|
||||
vulkan-loader
|
||||
xorg.libXdmcp
|
||||
xorg.xcbutilerrors
|
||||
seatd
|
||||
wlroots_0_19
|
||||
mesa
|
||||
libdrm
|
||||
vulkan-loader
|
||||
seatd
|
||||
];
|
||||
|
||||
inputsFrom = [
|
||||
self.packages.${system}.default
|
||||
self.packages.${system}.treeland.override {
|
||||
#It's submodule, prevent infinite loop calls
|
||||
waylib = null;
|
||||
qwlroot = null;
|
||||
}
|
||||
];
|
||||
|
||||
shellHook =
|
||||
|
|
@ -230,8 +206,8 @@
|
|||
''
|
||||
#export QT_LOGGING_RULES="*.debug=true;qt.*.debug=false"
|
||||
#export WAYLAND_DEBUG=1
|
||||
export QT_PLUGIN_PATH=${makeQtpluginPath (with pkgs.qt6; [ qtbase qtdeclarative qtquick3d qtimageformats qtwayland qt5compat qtsvg ])}
|
||||
export QML2_IMPORT_PATH=${makeQmlpluginPath (with pkgs; with qt6; [ qtdeclarative qtquick3d qt5compat deepin.dtk6declarative ] )}
|
||||
export QT_PLUGIN_PATH=${makeQtpluginPath (with pkgs.qt6; [ qtbase qtdeclarative qtimageformats qtwayland qtsvg ])}
|
||||
export QML2_IMPORT_PATH=${makeQmlpluginPath (with pkgs; with qt6; [ qtdeclarative deepin.dtk6declarative ] )}
|
||||
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,4 @@ add_subdirectory(dbus)
|
|||
add_subdirectory(dconfig)
|
||||
add_subdirectory(systemd)
|
||||
add_subdirectory(wayland-sessions)
|
||||
add_subdirectory(portal)
|
||||
add_subdirectory(polkit-1)
|
||||
add_subdirectory(cmake)
|
||||
|
|
|
|||
|
|
@ -276,6 +276,183 @@
|
|||
"description[zh_CN]": "当没有设置壁纸时,设置默认显示的壁纸",
|
||||
"permissions": "readwrite",
|
||||
"visibility": "public"
|
||||
},
|
||||
|
||||
"workspaceThumbHeight": {
|
||||
"value": 144,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Workspace thumbnail height",
|
||||
"name[zh_CN]": "工作区缩略图高度",
|
||||
"description": "Workspace thumbnail height",
|
||||
"description[zh_CN]": "工作区缩略图高度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"workspaceThumbMargin": {
|
||||
"value": 20,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Workspace thumbnail margin",
|
||||
"name[zh_CN]": "工作区缩略图边距",
|
||||
"description": "Workspace thumbnail margin",
|
||||
"description[zh_CN]": "工作区缩略图边距",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"workspaceThumbCornerRadius": {
|
||||
"value": 8,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Workspace thumbnail corner radius",
|
||||
"name[zh_CN]": "工作区缩略图圆角弧度",
|
||||
"description": "Workspace thumbnail corner radius",
|
||||
"description[zh_CN]": "工作区缩略图圆角弧度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"highlightBorderWidth": {
|
||||
"value": 4,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Highlight border width",
|
||||
"name[zh_CN]": "高亮边框宽度",
|
||||
"description": "Highlight border width",
|
||||
"description[zh_CN]": "高亮边框宽度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"minMultitaskviewSurfaceHeight": {
|
||||
"value": 232,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitask view surface minimal height",
|
||||
"name[zh_CN]": "多任务视图表面最小高度",
|
||||
"description": "Multitask view surface minimal height",
|
||||
"description[zh_CN]": "多任务视图表面最小高度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"titleBoxCornerRadius": {
|
||||
"value": 8,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Title box corner radius",
|
||||
"name[zh_CN]": "标题框圆角弧度",
|
||||
"description": "Title box corner radius",
|
||||
"description[zh_CN]": "标题框圆角弧度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"normalWindowHeight": {
|
||||
"value": 720,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Normal window height",
|
||||
"name[zh_CN]": "正常窗口高度",
|
||||
"description": "Normal window height",
|
||||
"description[zh_CN]": "正常窗口高度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"windowHeightStep": {
|
||||
"value": 15,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Window height step",
|
||||
"name[zh_CN]": "窗口高度梯度",
|
||||
"description": "Window height step",
|
||||
"description[zh_CN]": "窗口高度梯度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewPaddingOpacity": {
|
||||
"value": 0.1,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview padding opacity",
|
||||
"name[zh_CN]": "多任务视图内边距不透明度",
|
||||
"description": "Multitask view padding opacity",
|
||||
"description[zh_CN]": "多任务视图内边距不透明度",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewAnimationDuration": {
|
||||
"value": 300,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview animation duration",
|
||||
"name[zh_CN]": "多任务视图动画时长",
|
||||
"description": "Multitaskview animation duration",
|
||||
"description[zh_CN]": "多任务视图动画时长",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewEasingCurveType": {
|
||||
"value": 22,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview easing curve type",
|
||||
"name[zh_CN]": "多任务视图缓动曲线类型",
|
||||
"description": "Multitaskview easing curve type, enumerate value of QEasingCurve::Type",
|
||||
"description[zh_CN]": "多任务视图缓动曲线类型,其值为QEasingCurve::Type类型的枚举值",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewTopContentMargin": {
|
||||
"value": 40,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview top content margin",
|
||||
"name[zh_CN]": "多任务视图内容顶边距",
|
||||
"description": "Multitaskview top content margin",
|
||||
"description[zh_CN]": "多任务视图内容顶边距",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewBottomContentMargin": {
|
||||
"value": 60,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview bottom content margin",
|
||||
"name[zh_CN]": "多任务视图内容底边距",
|
||||
"description": "Multitaskview bottom content margin",
|
||||
"description[zh_CN]": "多任务视图内容底边距",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewHorizontalMargin": {
|
||||
"value": 20,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview horizontal margin",
|
||||
"name[zh_CN]": "多任务视图横向边距",
|
||||
"description": "Multitaskview horizontal margin",
|
||||
"description[zh_CN]": "多任务视图横向边距",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewCellPadding": {
|
||||
"value": 12,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview cell padding",
|
||||
"name[zh_CN]": "多任务视图单元格间距",
|
||||
"description": "Multitaskview cell padding",
|
||||
"description[zh_CN]": "多任务视图单元格间距",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
},
|
||||
"multitaskviewLoadFactor": {
|
||||
"value": 0.6,
|
||||
"serial": 0,
|
||||
"flags": ["global"],
|
||||
"name": "Multitaskview load factor",
|
||||
"name[zh_CN]": "多任务视图加载因子",
|
||||
"description": "Multitaskview load factor",
|
||||
"description[zh_CN]": "多任务视图加载因子",
|
||||
"permissions": "readonly",
|
||||
"visibility": "private"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
install(FILES
|
||||
"org.freedesktop.login1.rules"
|
||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/polkit-1/rules.d/"
|
||||
)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "org.freedesktop.login1.manage" && subject.user == "dde") {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
install(FILES
|
||||
"dde-portals.conf"
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_SYSCONFDIR}/xdg-desktop-portal"
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
[preferred]
|
||||
default=dde
|
||||
org.freedesktop.impl.portal.ScreenCast=wlr
|
||||
|
|
@ -20,7 +20,7 @@ PartOf=dde-session-pre.target
|
|||
Before=dde-session-pre.target
|
||||
|
||||
[Service]
|
||||
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_DESKTOP" = "treeland-user" || exit 2'
|
||||
ExecCondition=/bin/sh -c 'test "$TREELAND_RUN_MODE" = "user" || exit 2'
|
||||
Type=dbus
|
||||
BusName=org.deepin.Compositor1
|
||||
UnsetEnvironment=DISPLAY
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
Description=Treeland shutdown session service
|
||||
|
||||
[Service]
|
||||
ExecCondition=/bin/sh -c 'test "$XDG_SESSION_DESKTOP" = "treeland-user" || exit 2'
|
||||
ExecCondition=/bin/sh -c 'test "$TREELAND_RUN_MODE" = "user" || exit 2'
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/systemctl --user unset-environment XDG_SESSION_DESKTOP
|
||||
ExecStart=/usr/bin/systemctl --user unset-environment DESKTOP_SESSION
|
||||
ExecStart=/usr/bin/systemctl --user unset-environment XDG_SESSION_TYPE
|
||||
ExecStart=/usr/bin/systemctl --user unset-environment TREELAND_RUN_MODE
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ After=seatd.service
|
|||
User=dde
|
||||
Environment=LIBSEAT_BACKEND=seatd
|
||||
Environment=DSG_APP_ID=org.deepin.dde.treeland
|
||||
Environment=ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
|
||||
# For Debug: if enable asan, you can't get it's log from journalctl, so ensure the log to a file
|
||||
Environment=ASAN_OPTIONS=log_path=/tmp/treeland-asan:detect_leaks=0:abort_on_error=1:symbolize=1
|
||||
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/treeland.sh --lockscreen
|
||||
Restart=on-failure
|
||||
RestartSec=1s
|
||||
# Disable logs from treeland.sh to avoid duplicate entries in journalctl
|
||||
# since exec replaces the process, logs would appear from both treeland.sh and treeland
|
||||
StandardOutput=null
|
||||
StandardError=null
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
configure_file(treeland-user.desktop.in treeland-user.desktop)
|
||||
configure_file(treeland.desktop.in treeland.desktop)
|
||||
configure_file(treeland-user-wrapper.in treeland-user-wrapper)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/treeland.desktop
|
||||
|
|
@ -10,3 +11,8 @@ install(FILES
|
|||
${CMAKE_CURRENT_BINARY_DIR}/treeland-user.desktop
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/wayland-sessions"
|
||||
)
|
||||
|
||||
install(PROGRAMS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/treeland-user-wrapper
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
export TREELAND_RUN_MODE=user
|
||||
|
||||
exec ${CMAKE_INSTALL_FULL_BINDIR}/dde-session
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Name=Treeland
|
||||
Name=Treeland User
|
||||
Comment=This session is DDE single wayland
|
||||
Exec=${CMAKE_INSTALL_FULL_BINDIR}/dde-session
|
||||
Exec=${CMAKE_INSTALL_FULL_BINDIR}/treeland-user-wrapper
|
||||
TryExec=${CMAKE_INSTALL_FULL_BINDIR}/treeland
|
||||
Type=Application
|
||||
DesktopNames=Treeland
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
nix-filter,
|
||||
cmake,
|
||||
ninja,
|
||||
extra-cmake-modules,
|
||||
pkg-config,
|
||||
wayland-scanner,
|
||||
|
|
@ -13,27 +14,27 @@
|
|||
qtimageformats,
|
||||
qtwayland,
|
||||
qtsvg,
|
||||
qwlroots,
|
||||
ddm,
|
||||
deepin,
|
||||
waylib,
|
||||
wayland,
|
||||
wayland-protocols,
|
||||
wlr-protocols,
|
||||
wlroots_0_19,
|
||||
treeland-protocols,
|
||||
pixman,
|
||||
pam,
|
||||
libxcrypt,
|
||||
libinput,
|
||||
jemalloc,
|
||||
nixos-artwork,
|
||||
qwlroots,
|
||||
waylib,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "treeland";
|
||||
version = "0.2.2";
|
||||
version = "0.5-unstable";
|
||||
|
||||
src = nix-filter.filter {
|
||||
src = nix-filter.lib.filter {
|
||||
root = ./..;
|
||||
|
||||
exclude = [
|
||||
|
|
@ -42,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"LICENSES"
|
||||
"README.md"
|
||||
"README.zh_CN.md"
|
||||
(nix-filter.matchExt "nix")
|
||||
(nix-filter.lib.matchExt "nix")
|
||||
];
|
||||
};
|
||||
|
||||
|
|
@ -55,8 +56,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
done
|
||||
'';
|
||||
|
||||
depsBuildBuild = [ pkg-config ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
extra-cmake-modules
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
|
|
@ -70,29 +74,31 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
qtimageformats
|
||||
qtwayland
|
||||
qtsvg
|
||||
qwlroots
|
||||
ddm
|
||||
deepin.dtk6core
|
||||
deepin.dtk6declarative
|
||||
deepin.dtk6systemsettings
|
||||
waylib
|
||||
wayland
|
||||
wayland-protocols
|
||||
wlr-protocols
|
||||
treeland-protocols
|
||||
wlroots_0_19
|
||||
pixman
|
||||
pam
|
||||
libxcrypt
|
||||
libinput
|
||||
jemalloc
|
||||
qwlroots
|
||||
waylib
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DQT_IMPORTS_DIR=${placeholder "out"}/${qtbase.qtQmlPrefix}"
|
||||
"-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
|
||||
"-DSYSTEMD_SYSTEM_UNIT_DIR=${placeholder "out"}/lib/systemd/system"
|
||||
"-DSYSTEMD_SYSUSERS_DIR=${placeholder "out"}/lib/sysusers.d"
|
||||
"-DSYSTEMD_TMPFILES_DIR=${placeholder "out"}/lib/tmpfiles.d"
|
||||
"-DDBUS_CONFIG_DIR=${placeholder "out"}/share/dbus-1/system.d"
|
||||
(lib.cmakeFeature "QT_IMPORTS_DIR" "${placeholder "out"}/${qtbase.qtQmlPrefix}")
|
||||
(lib.cmakeFeature "CMAKE_INSTALL_SYSCONFDIR" "${placeholder "out"}/etc")
|
||||
(lib.cmakeFeature "SYSTEMD_SYSTEM_UNIT_DIR" "${placeholder "out"}/lib/systemd/system")
|
||||
(lib.cmakeFeature "SYSTEMD_SYSUSERS_DIR" "${placeholder "out"}/lib/sysusers.d")
|
||||
(lib.cmakeFeature "SYSTEMD_TMPFILES_DIR" "${placeholder "out"}/lib/tmpfiles.d")
|
||||
(lib.cmakeFeature "DBUS_CONFIG_DIR" "${placeholder "out"}/share/dbus-1/system.d")
|
||||
(lib.cmakeBool "WITH_SUBMODULE_WAYLIB" false)
|
||||
];
|
||||
|
||||
env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
# Don't index SpecStory auto-save files, but allow explicit context inclusion via @ references
|
||||
.specstory/**
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
watch_file default.nix
|
||||
watch_file nix/default.nix
|
||||
use flake
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
name: Build on archlinux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
container:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run in container
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Syu --noconfirm
|
||||
- name: Install dep
|
||||
run: |
|
||||
pacman -Syu --noconfirm qt6-base cmake pkgconfig wlroots0.19 pixman wayland-protocols wlr-protocols clazy
|
||||
pacman -Syu --noconfirm clang ninja
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
mkdir -p ${{github.workspace}}/build
|
||||
cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_CXX_COMPILER=clazy
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
name: REUSE Compliance Check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@v5
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
# C++ objects and libs
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.a
|
||||
*.la
|
||||
*.lai
|
||||
*.so
|
||||
*.so.*
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
# Qt-es
|
||||
object_script.*.Release
|
||||
object_script.*.Debug
|
||||
*_plugin_import.cpp
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
*.pro.user
|
||||
*.pro.user.*
|
||||
*.qbs.user
|
||||
*.qbs.user.*
|
||||
*.moc
|
||||
moc_*.cpp
|
||||
moc_*.h
|
||||
qrc_*.cpp
|
||||
ui_*.h
|
||||
*.qmlc
|
||||
*.jsc
|
||||
Makefile*
|
||||
*build-*
|
||||
*.qm
|
||||
*.prl
|
||||
|
||||
# Qt unit tests
|
||||
target_wrapper.*
|
||||
|
||||
# QtCreator
|
||||
*.autosave
|
||||
|
||||
# QtCreator Qml
|
||||
*.qmlproject.user
|
||||
*.qmlproject.user.*
|
||||
|
||||
# QtCreator CMake
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# QtCreator 4.8< compilation database
|
||||
compile_commands.json
|
||||
|
||||
# QtCreator local machine specific files for imported projects
|
||||
*creator.user*
|
||||
|
||||
build*/
|
||||
|
||||
# nix
|
||||
.direnv/
|
||||
result
|
||||
|
||||
# clangd
|
||||
.cache/
|
||||
|
||||
# vscode
|
||||
.vscode/
|
||||
qwlroots.code-workspace
|
||||
|
||||
# cursor
|
||||
.specstory
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "wlroots"]
|
||||
path = wlroots
|
||||
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
test_build:
|
||||
steps:
|
||||
- link_package:
|
||||
source_project: vioken
|
||||
source_package: %{SCM_REPOSITORY_NAME}
|
||||
target_project: vioken:CI
|
||||
|
||||
- configure_repositories:
|
||||
project: vioken:CI
|
||||
repositories:
|
||||
- name: deepin_ci
|
||||
paths:
|
||||
- target_project: vioken
|
||||
target_repository: deepin_develop
|
||||
architectures:
|
||||
- x86_64
|
||||
- aarch64
|
||||
|
||||
- name: debian
|
||||
paths:
|
||||
- target_project: vioken
|
||||
target_repository: Debian_Sid
|
||||
architectures:
|
||||
- x86_64
|
||||
filters:
|
||||
event: pull_request
|
||||
|
||||
commit_build:
|
||||
steps:
|
||||
- trigger_services:
|
||||
project: vioken
|
||||
package: %{SCM_REPOSITORY_NAME}
|
||||
filters:
|
||||
event: push
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
test_build:
|
||||
steps:
|
||||
- link_package:
|
||||
source_project: home:rewine:vioken
|
||||
source_package: %{SCM_REPOSITORY_NAME}
|
||||
target_project: home:rewine:vioken:CI
|
||||
|
||||
- configure_repositories:
|
||||
project: home:rewine:vioken:CI
|
||||
repositories:
|
||||
- name: Arch
|
||||
paths:
|
||||
- target_project: home:rewine:vioken
|
||||
target_repository: Arch
|
||||
architectures:
|
||||
- x86_64
|
||||
|
||||
#- name: Fedora_Rawhide
|
||||
# paths:
|
||||
# - target_project: home:rewine:vioken
|
||||
# target_repository: Fedora_Rawhide
|
||||
# architectures:
|
||||
# - x86_64
|
||||
|
||||
- name: openSUSE_Tumbleweed
|
||||
paths:
|
||||
- target_project: home:rewine:vioken
|
||||
target_repository: openSUSE_Tumbleweed
|
||||
architectures:
|
||||
- x86_64
|
||||
- aarch64
|
||||
filters:
|
||||
event: pull_request
|
||||
|
||||
commit_build:
|
||||
steps:
|
||||
- trigger_services:
|
||||
project: home:rewine:vioken
|
||||
package: %{SCM_REPOSITORY_NAME}
|
||||
filters:
|
||||
event: push
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: qwlroots
|
||||
Upstream-Contact: JiDe Zhang <zccrs@live.com>
|
||||
Source: https://github.com/vioken/qwlroots
|
||||
|
||||
# ci
|
||||
Files: .github/* .obs/*.yml garnix.yaml
|
||||
Copyright: None
|
||||
License: CC0-1.0
|
||||
|
||||
# Project file
|
||||
Files: *.cmake *CMakeLists.txt *.pc.in *cmake.in .gitignore .cursorindexingignore .cursor/rules/*.mdc .gitmodules
|
||||
Copyright: None
|
||||
License: CC0-1.0
|
||||
|
||||
# Simple header files, only used to include qwinputdevice.h
|
||||
Files: */qwkeyboard.h */qwpointer.h */qwswitch.h */qwtablet.h */qwtabletpad.h */qwtouch.h
|
||||
Copyright: None
|
||||
License: CC0-1.0
|
||||
|
||||
# README and documentation
|
||||
Files: README.md README.zh_CN.md doc/ai/*.md
|
||||
Copyright: JiDe Zhang
|
||||
License: CC-BY-4.0
|
||||
|
||||
# Nix Develop files
|
||||
Files: *.nix .envrc flake.lock
|
||||
Copyright: None
|
||||
License: CC0-1.0
|
||||
|
||||
# deb package
|
||||
Files: debian/*
|
||||
Copyright: 2023 rewine <luhongxu@outlook.com>
|
||||
License: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
project(QWlroots
|
||||
VERSION 0.5.3
|
||||
LANGUAGES CXX C)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
option(PREFER_QT_5 "Prefer to use Qt 5 even if we have Qt 6" OFF)
|
||||
option(USE_WLROOTS_19 "Use wlroots 0.19 version" ON)
|
||||
option(QWLROOTS_USE_PERCOMPILE_HEADERS "Use precompile headers to build qwlroots" OFF)
|
||||
option(DISABLE_WLR_PROTOCOLS "Disable support for wlr protocols, such as wlr-layer-shell" OFF)
|
||||
option(DISABLE_XWAYLAND "Disable the xwayland support" OFF)
|
||||
|
||||
if(PREFER_QT_5)
|
||||
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
|
||||
else()
|
||||
find_package(QT NAMES Qt6 QUIET COMPONENTS Core)
|
||||
if (NOT QT_FOUND)
|
||||
message(FATAL_ERROR "Not found Qt6, set `PREFER_QT_5` option if you want to use Qt5")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
|
||||
include(PackageVersionHelper)
|
||||
include(WaylandScannerHelpers)
|
||||
|
||||
# For Unix/Linux
|
||||
include(GNUInstallDirs)
|
||||
|
||||
add_subdirectory(src)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(examples)
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "ci",
|
||||
"displayName": "CI Build Config",
|
||||
"description": "Build configuration with warnings as errors",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror",
|
||||
"CMAKE_C_FLAGS": "-Wall -Wextra -Werror"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "ci",
|
||||
"configurePreset": "ci",
|
||||
"jobs": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
Creative Commons Attribution 4.0 International
|
||||
|
||||
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
|
||||
|
||||
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
|
||||
|
||||
Creative Commons Attribution 4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
|
||||
|
||||
Section 1 – Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
|
||||
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
|
||||
|
||||
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
|
||||
|
||||
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
|
||||
|
||||
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
|
||||
|
||||
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
|
||||
|
||||
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
|
||||
|
||||
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
A. reproduce and Share the Licensed Material, in whole or in part; and
|
||||
|
||||
B. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section 6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
|
||||
|
||||
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
|
||||
|
||||
Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified form), You must:
|
||||
|
||||
A. retain the following if it is supplied by the Licensor with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
|
||||
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
|
||||
|
||||
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
|
||||
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
|
||||
|
||||
Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
|
||||
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
|
||||
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
|
||||
|
||||
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
|
||||
|
||||
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
|
|
@ -0,0 +1,339 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
# qwlroots
|
||||
|
||||
## Language
|
||||
|
||||
[简体中文](./README.zh_CN.md)
|
||||
|
||||
## Introduction
|
||||
|
||||
qwlroots is a binding of [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) that provides a Qt style development interface. It aims to simplify the process of calling wlroots API within Qt projects. In qwlroots, each wlroots struct is wrapped as a C++ class with corresponding member functions. Additionally, wl_signals in Wayland are wrapped as Qt signals.
|
||||
|
||||
## Supported wlroots versions
|
||||
|
||||
As wlroots is still under development and has not yet released its 1.0 version, significant changes may occur at any time. Therefore, the latest code of qwlroots is only guaranteed to be compatible with the latest version of wlroots and the next release version (i.e., the version currently in development); compatibility with historical versions is not guaranteed. Similarly, like wlroots, qwlroots currently does not provide long-term support for interface compatibility.
|
||||
|
||||
Currently, qwlroots is compatible with the following versions of wlroots: 0.18.x, 0.19.x
|
||||
|
||||
## Supported Environments
|
||||
|
||||
* Arch Linux
|
||||
* Debian
|
||||
* deepin
|
||||
* openSUSE
|
||||
* NixOS
|
||||
|
||||
> Other environments have not been tested yet.
|
||||
|
||||
## Build
|
||||
|
||||
Step 1: Compile and Install wlroots
|
||||
|
||||
Follow the instructions in [building wlroots](https://gitlab.freedesktop.org/wlroots/wlroots#building) to compile and install wlroots.
|
||||
|
||||
> You can also install wlroots using a system package manager, but pay attention to the version.
|
||||
|
||||
Step 2: Install Dependencies
|
||||
|
||||
For Debian
|
||||
|
||||
````shell
|
||||
apt install pkg-config cmake qt6-base-private-dev qt6-base-dev-tools wayland-protocols libpixman-1-dev
|
||||
````
|
||||
|
||||
For Arch Linux
|
||||
|
||||
````shell
|
||||
pacman -Syu --noconfirm qt6-base cmake pkgconfig pixman wayland-protocols ninja
|
||||
````
|
||||
|
||||
Step 3: Run the Following Commands
|
||||
|
||||
```shell
|
||||
cmake -B build
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
We also use the Open Build Service and Garnix to provide automated build and testing services for openSUSE, deepin, and NixOS. See the [openSUSE](https://build.opensuse.org/package/show/home:rewine:vioken/qwlroots), [deepin](https://build.deepin.com/package/show/vioken/qwlroots) and [NixOS](https://garnix.io/docs/caching) for package downloads.
|
||||
|
||||
## How to contribute
|
||||
|
||||
We assume the you have already had experience with `Qt` and `wlroots` libraries. To better integrate Qt with wlroots, qwlroots follows the Qt specifications in terms of interface style, adheres to wlroots' design philosophy regarding low-level design concepts (e.g., module separation), and adopts Qt's "encapsulation + hierarchy" design philosophy for high-level components that are not directly related to wlroots.
|
||||
|
||||
You are free to submit as many code contributions to this project as you like, as long as you follow the design philosophy of qwlroots and the guidelines below.
|
||||
|
||||
### Coding Style
|
||||
|
||||
* When modifying existing code, adhere to the current coding style.
|
||||
* There is no absolute right or wrong code style; consider the project as a whole rather than focusing on small parts.
|
||||
|
||||
### Code Quality
|
||||
|
||||
* Simplicity and understandability come first.
|
||||
* Add comments in important areas, whether you are modifying or adding code.
|
||||
* Security > Compatibility > Scalability >= Performance
|
||||
|
||||
### Commit Guidelines
|
||||
|
||||
* Commit Steps:
|
||||
|
||||
1. First, you need to log in to your GitHub account and fork this project.
|
||||
2. Use `git clone` to get the forked project locally
|
||||
3. Push new commits to your project with `git push`
|
||||
4. Submit your code to the upstream project with the "Pull Request" function on Github.
|
||||
* Commit Message Guidelines: Follow the conventions used in Qt projects and write in English. Be sure to clearly describe "what the commit does" and "why this approach was taken."
|
||||
* Each commit should perform a single task; the smaller the changes to the code, the more likely the commit will be accepted. For large code changes, try to split the commit into multiple smaller commits (while satisfying the principles of git commits).
|
||||
* Please conduct testing and code reviews on your own before submitting your code, and only submit the pull request after confirming that the code is error-free.
|
||||
|
||||
## Wrapping Coverage Status
|
||||
|
||||
qwlroots provides Qt-style bindings for wlroots types. The following table shows the current wrapping coverage based on wlroots 0.19.0:
|
||||
|
||||
| Category | Wrapped | Total Available | Coverage |
|
||||
| --------------- | ------------ | --------------- | --------------- |
|
||||
| Types | 67 | 74 | 90.5% |
|
||||
| Util | 3 | 6 | 50.0% |
|
||||
| Render | 5 | 14 | 35.7% |
|
||||
| Interfaces | 9 | 9 | 100.0% |
|
||||
| **Total** | **83** | **103** | **80.6%** |
|
||||
|
||||
### Unwrapped Types (as of wlroots 0.19.0)
|
||||
|
||||
The following wlroots types are not yet wrapped in qwlroots:
|
||||
|
||||
**Types (20 remaining):**
|
||||
|
||||
- alpha_modifier_v1, color_management_v1, ext_data_control_v1, ext_image_capture_source_v1, ext_image_copy_capture_v1, foreign_toplevel_management_v1
|
||||
- fractional_scale_v1, gamma_control_v1, linux_drm_syncobj_v1, output_swapchain_manager
|
||||
- presentation_time, security_context_v1, server_decoration, tablet_tool, transient_seat_v1
|
||||
- xdg_decoration_v1, xdg_dialog_v1, xdg_system_bell_v1, xdg_toplevel_icon_v1
|
||||
|
||||
**Util (3 remaining):**
|
||||
|
||||
- addon, edges, log, region, transform
|
||||
|
||||
**Render (9 remaining):**
|
||||
|
||||
- color, dmabuf, drm_format_set, drm_syncobj, gles2, interface, pass, pixman, vulkan
|
||||
|
||||
**Interfaces (9 remaining):**
|
||||
|
||||
- buffer, ext_image_capture_source_v1, keyboard, output, pointer, switch, tablet_pad, tablet_tool, touch
|
||||
|
||||
> Note: This analysis is based on the wlroots submodule at version 0.19.0. To update this information, run `python3 analyze_coverage.py` in the project root.
|
||||
|
||||
### How to Update Coverage Information
|
||||
|
||||
Use the provided analysis tool to calculate and update wrapping coverage:
|
||||
|
||||
```bash
|
||||
# Run the coverage analysis script
|
||||
python3 analyze_coverage.py
|
||||
```
|
||||
|
||||
The script works by:
|
||||
|
||||
- Scanning `src/` directories for existing qwlroots wrappers
|
||||
- Scanning `wlroots/include/wlr/` directories for available wlroots types
|
||||
- Comparing the two sets to calculate coverage percentages
|
||||
- Generating detailed lists of unwrapped types
|
||||
|
||||
The tool automatically handles naming conventions (e.g., `wlr_compositor.h` ↔ `qwcompositor.h`) and outputs coverage statistics for each category (types, util, render, interfaces).
|
||||
|
||||
## Documentation for AI Assistants
|
||||
|
||||
The `doc/ai/` directory contains specialized documentation designed for AI assistants to understand and work with the qwlroots codebase:
|
||||
|
||||
- **[qwlroots-wrapping-patterns-best-practices-en.md](./doc/ai/qwlroots-wrapping-patterns-best-practices-en.md)**: Comprehensive English guide covering all four wrapping patterns (QW_CLASS_OBJECT, QW_CLASS_REINTERPRET_CAST, QW_CLASS_BOX, QW_CLASS_INTERFACE) with detailed examples and step-by-step instructions for adding new wrappers.
|
||||
- **[qwlroots-wrapping-patterns-best-practices.md](./doc/ai/qwlroots-wrapping-patterns-best-practices.md)**: Chinese version of the wrapping patterns guide with the same comprehensive coverage.
|
||||
|
||||
These documents serve as reference materials for AI assistants when:
|
||||
|
||||
- Adding new wlroots type wrappers
|
||||
- Understanding the project's architecture and design patterns
|
||||
- Following consistent coding practices and naming conventions
|
||||
- Implementing proper version compatibility handling
|
||||
|
||||
The AI documentation includes complete workflows, from updating the wlroots submodule to implementing and testing new wrappers, ensuring consistency and maintainability across the codebase.
|
||||
|
||||
## General Requirements
|
||||
|
||||
### When Wrapping a New wlroots Type
|
||||
|
||||
For detailed guidance on wrapping new wlroots types, please refer to our comprehensive [Wrapping Patterns Best Practices Guide](./doc/ai/qwlroots-wrapping-patterns-best-practices-en.md), which covers all four wrapping patterns and provides step-by-step instructions.
|
||||
|
||||
We also provide a demo [example of qw_abc](https://github.com/vioken/qwlroots/tree/master/tests/qwobject_test) in unit test for reference when wrapping a new wlroots type.
|
||||
|
||||
* First, check if this type provides signals. If so, wrap it with QW_CLASS_OBJECT; otherwise, wrap it with QW_CLASS_REINTERPRET_CAST.
|
||||
|
||||
* For wlr_abc, using QW_CLASS_OBJECT(abc) will declare a class named qw_abc based on qw_object(QObject).
|
||||
* qw_abc provides a handle() function to access the `wlr_abc*` type and supports implicit conversion to the `wlr_abc*` type.
|
||||
* qw_abc provides a from() function to acquire `qw_abc*` from `wlr_abc*`. If there is no corresponding qw_abc, a new instance will be created.
|
||||
* qw_abc provides a get() function to acquire `qw_abc*` from `wlr_abc*`. If there is no corresponding qw_abc, it returns nullptr.
|
||||
* qw_abc will automatically connect to wlr_abc's destroy signal (if it exists) and will be automatically destroyed while emitting the qt signal before_destroy when wlr_abc is destroyed.
|
||||
* If qw_abc is explicitly destroyed, the wlr_abc handle will only be destroyed if the owner of the handle is qw_abc itself.
|
||||
* qw_abc created by the from() function is not the owner of its handle; only qw_abc created by the create() function will be its handle's owner.
|
||||
* QW_CLASS_REINTERPRET_CAST is essentially a cast from the handle. It does not allocate extra memory.
|
||||
* For types with signals, you should add QW_OBJECT and Q_OBJECT macros to the class, and use QW_SIGNAL to bind signals.
|
||||
|
||||
* The first argument of the QW_SIGNAL it the name of signal, followed by the argument list of the signal itself.
|
||||
* In the example of qw_abc, QW_SIGNAL(set_name, char *) forwards wlr_abc's events.set_name signal to qw::notify_set_name.
|
||||
* The destroy signal is a special signal that is already handled in the base class qw_object; there is no need for manual binding.
|
||||
* Use QW_FUNC_STATIC and QW_FUNC_MEMBER to bind functions. Functions should generally be public.
|
||||
|
||||
* The arguments of QW_FUNC_MEMBER are the function name, return type and argument list. The first argument is always the handle; there is no need to declare it.
|
||||
* For example, `QW_FUNC_MEMBER(abc, sum, int)` will bind `int wlr_abc_sum(wlr_abc *)` to `int qw_abc::sum()`.
|
||||
* QW_FUNC_STATIC differs from QW_FUNC_MEMBER in that the first argument is not the handle; it will declare a static function of class qw_abc.
|
||||
* If the name of the function forwarded by QW_FUNC_STATIC contains create or get and the return type is the handle type, you should use the qw type as the return value type. For example, `QW_FUNC_STATIC(abc, create, qw_abc*, wl_display*)` will expand to `static qw_abc *qw_abc::create(wl_display *)`, which wraps the function `wlr_abc *wlr_abc_create(wl_display *)`. The return value will be automatically wrapped as a qw type.
|
||||
* For classes that provide a destroy method, the destructor should generally be protected to prevent non-handle owners from calling it to destroy the handle. The destructor will be called automatically when the qw type is deleted (for cast types) or when the destructor of the qw type is invoked (for qw_object).
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
# qwlroots
|
||||
|
||||
## 选择语言
|
||||
|
||||
[English](./README.md)
|
||||
|
||||
## 简介
|
||||
|
||||
qwlroots 是一个 [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) 的绑定,提供 Qt 风格的开发接口。其设计目标是简化在Qt项目中调用 wlroots API 的方式。在 qwlroots 中,每一个 wlroots struct 及其配套的函数被封装为一个 c++ class,同时,wayland 中的 wl_singal 被封装为 Qt 中的信号。
|
||||
|
||||
## 受支持的 wlroots 版本
|
||||
|
||||
由于 wlroots 还处于开发中,至今未发布 1.0 版本,可能会随时进行比较大的改动。因此,原则上 qwlroots 的最新代码仅保证兼容 wlroots 的最新版本和下一个即将发布的版本(即目前还处于开发中的版本),对于历史版本一概不保证兼容。同 wlroots 一样,qwlroots 目前也不提供长期的接口兼容性保障。
|
||||
|
||||
当前 qwlroots 兼容的wlroots版本是: 0.18.x, 0.19.x。
|
||||
|
||||
## 支持的环境
|
||||
|
||||
* Arch Linux
|
||||
* Debian
|
||||
* deepin
|
||||
* openSUSE
|
||||
* NixOS
|
||||
|
||||
> 其它环境未测试
|
||||
|
||||
## 构建
|
||||
|
||||
步骤一:编译安装 [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots#building)
|
||||
|
||||
> 亦可使用系统包管理器安装 wlroots (需注意版本)
|
||||
|
||||
步骤二:安装依赖
|
||||
|
||||
Debian
|
||||
|
||||
````shell
|
||||
apt install pkg-config cmake qt6-base-private-dev qt6-base-dev-tools wayland-protocols libpixman-1-dev
|
||||
````
|
||||
|
||||
Arch Linux
|
||||
|
||||
````shell
|
||||
pacman -Syu --noconfirm qt6-base cmake pkgconfig pixman wayland-protocols ninja
|
||||
````
|
||||
|
||||
步骤三:运行以下命令
|
||||
|
||||
```shell
|
||||
cmake -B build
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
此外我们使用 open build service 和 garnix 提供的自动化构建测试, 同时提供了 [openSUSE](https://build.opensuse.org/package/show/home:rewine:vioken/qwlroots), [deepin](https://build.deepin.com/package/show/vioken/qwlroots), [NixOS](https://garnix.io/docs/caching) 的软件包下载。
|
||||
|
||||
## 贡献指南
|
||||
|
||||
此项目默认您已经拥有 `Qt`和 `wlroots`库的使用经验,为了能更好的融合 Qt 和 wlroots,qwlroots 在接口风格上遵守Qt的相关规范,在底层的设计理念(如模块划分)上遵守 wlroots 的设计思想,上层与 wlroots 无直接关联的部分则遵守 Qt 的“封装+分层”的设计思想。
|
||||
|
||||
在遵守 qwlroots 的设计理念和以下几类要求的前提下,您可以自由地向此项目提交任意的代码贡献。
|
||||
|
||||
### 编码风格
|
||||
|
||||
* qwlroots 代码高度模板化,建议参考当前的代码风格
|
||||
* 代码风格没有绝对的对与错,请顾全大局,而勿拘于小结
|
||||
|
||||
### 代码质量
|
||||
|
||||
* 代码以简单明了、容易理解为优先
|
||||
* 无论是改动或新增代码,均需要在关键节点增加注释
|
||||
* 安全性 > 兼容性 > 可扩展性 >= 性能
|
||||
|
||||
### 提交规范
|
||||
|
||||
* 提交步骤:
|
||||
|
||||
1. 首先需要登录您的 GitHub 帐号,fork 此项目
|
||||
2. 在本地使用 `git clone`拉取fork之后的项目
|
||||
3. 将新的提交使用 `git push`推送到您的项目中
|
||||
4. 在 GitHub 上使用 Pull Requese 功能提交您的代码到上游项目
|
||||
* commit 信息规范:与 Qt 项目保持一致,统一使用英文。一定要准确描述出这个提交“做了什么”、“为什么要这样做”
|
||||
* 一个 commit 只做一件事情,代码量改动越小的 commit 越容易被接受。对于较大的代码改动,尽量拆分为多个代码提交(满足 git commit 的原则为前提)
|
||||
* 在提交代码之前请自行进行测试和代码 Review,在确认代码无误后再提交 PR
|
||||
|
||||
## 封装覆盖率状态
|
||||
|
||||
qwlroots 为 wlroots 类型提供 Qt 风格的绑定。下表显示了基于 wlroots 0.19.0 的当前封装覆盖率:
|
||||
|
||||
| 分类 | 已封装 | 总可用数 | 覆盖率 |
|
||||
| -------------- | ------------ | ------------- | --------------- |
|
||||
| Types | 66 | 74 | 89.2% |
|
||||
| Util | 3 | 6 | 50.0% |
|
||||
| Render | 5 | 14 | 35.7% |
|
||||
| Interfaces | 9 | 9 | 100.0% |
|
||||
| **总计** | **83** | **103** | **80.6%** |
|
||||
|
||||
### 未封装的类型(截至 wlroots 0.19.0)
|
||||
|
||||
以下 wlroots 类型尚未在 qwlroots 中封装:
|
||||
|
||||
**Types(剩余 20 个):**
|
||||
|
||||
- alpha_modifier_v1, color_management_v1, ext_data_control_v1, ext_foreign_toplevel_list_v1
|
||||
- ext_image_capture_source_v1, ext_image_copy_capture_v1, foreign_toplevel_management_v1
|
||||
- fractional_scale_v1, gamma_control_v1, linux_drm_syncobj_v1, output_swapchain_manager
|
||||
- presentation_time, security_context_v1, server_decoration, tablet_tool, transient_seat_v1
|
||||
- xdg_decoration_v1, xdg_dialog_v1, xdg_system_bell_v1, xdg_toplevel_icon_v1
|
||||
|
||||
**Util(剩余 3 个):**
|
||||
|
||||
- addon, edges, log, region, transform
|
||||
|
||||
**Render(剩余 9 个):**
|
||||
|
||||
- color, dmabuf, drm_format_set, drm_syncobj, gles2, interface, pass, pixman, vulkan
|
||||
|
||||
**Interfaces(剩余 9 个):**
|
||||
|
||||
- buffer, ext_image_capture_source_v1, keyboard, output, pointer, switch, tablet_pad, tablet_tool, touch
|
||||
|
||||
> 注意:此分析基于版本 0.19.0 的 wlroots 子模块。要更新此信息,请在项目根目录运行 `python3 analyze_coverage.py`。
|
||||
|
||||
### 如何更新覆盖率信息
|
||||
|
||||
使用提供的分析工具来计算和更新封装覆盖率:
|
||||
|
||||
```bash
|
||||
# 运行覆盖率分析脚本
|
||||
python3 analyze_coverage.py
|
||||
```
|
||||
|
||||
脚本工作原理:
|
||||
|
||||
- 扫描 `src/` 目录中现有的 qwlroots 封装
|
||||
- 扫描 `wlroots/include/wlr/` 目录中可用的 wlroots 类型
|
||||
- 比较两个集合来计算覆盖率百分比
|
||||
- 生成详细的未封装类型列表
|
||||
|
||||
工具自动处理命名约定(如 `wlr_compositor.h` ↔ `qwcompositor.h`)并输出各个分类(types、util、render、interfaces)的覆盖率统计。
|
||||
|
||||
## AI 助手文档
|
||||
|
||||
`doc/ai/` 目录包含专为 AI 助手设计的文档,用于理解和使用 qwlroots 代码库:
|
||||
|
||||
- **[qwlroots-wrapping-patterns-best-practices.md](./doc/ai/qwlroots-wrapping-patterns-best-practices.md)**: 中文版综合指南,涵盖所有四种封装模式(QW_CLASS_OBJECT、QW_CLASS_REINTERPRET_CAST、QW_CLASS_BOX、QW_CLASS_INTERFACE),包含详细示例和添加新封装的分步说明。
|
||||
- **[qwlroots-wrapping-patterns-best-practices-en.md](./doc/ai/qwlroots-wrapping-patterns-best-practices-en.md)**: 英文版封装模式指南,内容与中文版相同。
|
||||
|
||||
这些文档作为 AI 助手的参考资料,用于:
|
||||
|
||||
- 添加新的 wlroots 类型封装
|
||||
- 理解项目的架构和设计模式
|
||||
- 遵循一致的编码实践和命名约定
|
||||
- 实现适当的版本兼容性处理
|
||||
|
||||
AI 文档包含完整的工作流程,从更新 wlroots 子模块到实现和测试新封装,确保代码库的一致性和可维护性。
|
||||
|
||||
## 一些或许是通用的要求
|
||||
|
||||
### 封装新的 wlroots 类型时
|
||||
|
||||
关于封装新的 wlroots 类型的详细指导,请参考我们的综合性 [封装模式最佳实践指南](./doc/ai/qwlroots-wrapping-patterns-best-practices.md),该指南涵盖了所有四种封装模式并提供了分步说明。
|
||||
|
||||
在单元测试中提供了一个 [qw_abc 的示例](https://github.com/vioken/qwlroots/tree/master/tests/qwobject_test), 可以作为使用 qwlroots 的参考。
|
||||
|
||||
* 首先检查这种类型是否提供信号,有信号的类型使用 QW_CLASS_OBJECT 封装,无信号类型使用 QW_CLASS_REINTERPRET_CAST 封装
|
||||
* wlr_abc, 使用 QW_CLASS_OBJECT(abc) 会声明基于 qw_object(QObject)的 qw_abc 类
|
||||
* qw_abc 提供 handle() 函数访问 wlr_abc 类型,同时支持到 wlr_abc* 的隐式转换
|
||||
* 提供 from 函数从 wlr_abc* 获取 qw_abc,如果没有对应 qw_abc 则会创建一个
|
||||
* 提供 get 函数从 wlr_abc* 获取 qw_abc,如果没有对应 qw_abc 则返回 nullptr
|
||||
* qw_abc 会自动连接 wlr_abc 的 destroy 信号(如果有),自动析构,并在销毁前发出 qt 信号 before_destroy
|
||||
* 如果主动析构 qw_abc,只有是 handle 的 owner 才会销毁 wlr_abc 类型
|
||||
* from 函数创建的 qw_abc 都不是 handle 的 owner,只有下文提到的 create 创建出的是 owner
|
||||
* QW_CLASS_REINTERPRET_CAST 本质是对 handle 的强转,不分配额外内存
|
||||
* 对于有信号类型,需要添加 QW_OBJECT 和 Q_OBJECT 宏,使用 QW_SIGNAL 进行信号绑定
|
||||
* QW_SIGNAL 第一个参数是名字,之后是信号参数
|
||||
* 在 qw_abc 例子中 QW_SIGNAL(set_name, char*) 将 wlr_abc 的 events.set_name 信号转为 qw::notify_set_name
|
||||
* destroy 是比较特殊的信号,在 qw_object 基类中已经处理,无需手动绑定
|
||||
* 对成员函数,使用 QW_FUNC_STATIC 和 QW_FUNC_MEMBER 进行绑定,它们通常应该是 public 的
|
||||
* QW_FUNC_MEMBER 参数为函数名,返回值类型,和函数参数。其中函数参数第一个固定传入 handle, 不用填。
|
||||
* 以 `QW_FUNC_MEMBER(abc, sum, int)` 为例,将 `int wlr_abc_sum(wlr_abc *)` 绑定到成员函数 `int qw_abc::sum()`
|
||||
* QW_FUNC_STATIC 不同的地方是函数参数第一个传入的不是 handle,会为 qw_abc 添加静态成员函数。
|
||||
* 需要使用 QW_FUNC_STATIC 的函数如果名字有 create/get ,返回值是 handle 类型,应该直接填 qw 类型,比如 `QW_FUNC_STATIC(abc, create, qw_abc*, wl_display*)`, 将 `wlr_abc *wlr_abc_create(wl_display *)` 封装为 `static qw_abc *qw_abc::create(wl_display *)` 返回值自动转换
|
||||
* 对于提供 destroy 方法的类,一般情况标记为 protected,防止非 handle 的 owner 调用此函数销毁 wlr_abc 类型。该方法会在调用 delete(强转类型)或者析构函数(qw_object类型)时被自动调用。
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2025 UnionTech Software Technology Co., Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
import os
|
||||
import glob
|
||||
|
||||
def normalize_name(name):
|
||||
"""标准化名称,处理下划线"""
|
||||
return name.replace('_', '')
|
||||
|
||||
def get_qwlroots_wrapped():
|
||||
"""获取qwlroots已封装的类型"""
|
||||
wrapped = {}
|
||||
|
||||
# types目录
|
||||
types_files = glob.glob("src/types/qw*.h")
|
||||
wrapped['types'] = set()
|
||||
for f in types_files:
|
||||
name = os.path.basename(f).removeprefix('qw').removesuffix('.h') # 去掉qw前缀和.h后缀
|
||||
wrapped['types'].add(normalize_name(name))
|
||||
|
||||
# util目录
|
||||
util_files = glob.glob("src/util/qw*.h")
|
||||
wrapped['util'] = set()
|
||||
for f in util_files:
|
||||
name = os.path.basename(f).removeprefix('qw').removesuffix('.h')
|
||||
wrapped['util'].add(normalize_name(name))
|
||||
|
||||
# render目录
|
||||
render_files = glob.glob("src/render/qw*.h")
|
||||
wrapped['render'] = set()
|
||||
for f in render_files:
|
||||
name = os.path.basename(f).removeprefix('qw').removesuffix('.h')
|
||||
wrapped['render'].add(normalize_name(name))
|
||||
|
||||
# interfaces目录
|
||||
interface_files = glob.glob("src/interfaces/qw*.h")
|
||||
wrapped['interfaces'] = set()
|
||||
for f in interface_files:
|
||||
name = os.path.basename(f).removeprefix('qw').removesuffix('.h')
|
||||
wrapped['interfaces'].add(normalize_name(name))
|
||||
|
||||
return wrapped
|
||||
|
||||
def get_wlroots_available():
|
||||
"""获取wlroots可用的类型"""
|
||||
available = {}
|
||||
|
||||
# types目录
|
||||
types_files = glob.glob("wlroots/include/wlr/types/wlr_*.h")
|
||||
available['types'] = set()
|
||||
for f in types_files:
|
||||
name = os.path.basename(f)[4:-2] # 去掉wlr_前缀和.h后缀
|
||||
available['types'].add(normalize_name(name))
|
||||
|
||||
# util目录
|
||||
util_files = glob.glob("wlroots/include/wlr/util/*.h")
|
||||
available['util'] = set()
|
||||
for f in util_files:
|
||||
name = os.path.basename(f)[:-2]
|
||||
available['util'].add(normalize_name(name))
|
||||
|
||||
# render目录
|
||||
render_files = glob.glob("wlroots/include/wlr/render/*.h")
|
||||
available['render'] = set()
|
||||
for f in render_files:
|
||||
name = os.path.basename(f)[:-2]
|
||||
if name.startswith('wlr_'):
|
||||
name = name[4:] # 去掉wlr_前缀
|
||||
available['render'].add(normalize_name(name))
|
||||
|
||||
# interfaces目录
|
||||
interface_files = glob.glob("wlroots/include/wlr/interfaces/*.h")
|
||||
available['interfaces'] = set()
|
||||
for f in interface_files:
|
||||
name = os.path.basename(f)[:-2]
|
||||
if name.startswith('wlr_'):
|
||||
name = name[4:] # 去掉wlr_前缀
|
||||
available['interfaces'].add(normalize_name(name))
|
||||
|
||||
return available
|
||||
|
||||
def analyze_coverage():
|
||||
wrapped = get_qwlroots_wrapped()
|
||||
available = get_wlroots_available()
|
||||
|
||||
print("# qwlroots 封装覆盖率分析 (基于 wlroots 0.19.0)")
|
||||
print()
|
||||
|
||||
total_wrapped = 0
|
||||
total_available = 0
|
||||
|
||||
for category in ['types', 'util', 'render', 'interfaces']:
|
||||
wrapped_set = wrapped.get(category, set())
|
||||
available_set = available.get(category, set())
|
||||
|
||||
missing = available_set - wrapped_set
|
||||
|
||||
print(f"## {category.title()} 目录")
|
||||
print(f"- 已封装: {len(wrapped_set)}")
|
||||
print(f"- 可用总数: {len(available_set)}")
|
||||
if len(available_set) > 0:
|
||||
print(f"- 覆盖率: {len(wrapped_set)/len(available_set)*100:.1f}%")
|
||||
else:
|
||||
print(f"- 覆盖率: N/A")
|
||||
|
||||
if missing:
|
||||
print(f"- 未封装的类型:")
|
||||
for item in sorted(missing):
|
||||
print(f" - {item}")
|
||||
else:
|
||||
print("- ✅ 所有类型都已封装")
|
||||
print()
|
||||
|
||||
total_wrapped += len(wrapped_set)
|
||||
total_available += len(available_set)
|
||||
|
||||
print(f"## 总体覆盖率")
|
||||
print(f"- 总已封装: {total_wrapped}")
|
||||
print(f"- 总可用: {total_available}")
|
||||
if total_available > 0:
|
||||
print(f"- 总覆盖率: {total_wrapped/total_available*100:.1f}%")
|
||||
|
||||
if __name__ == "__main__":
|
||||
analyze_coverage()
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
function(add_cmake_module name library include_dir)
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(${PROJECT_SOURCE_DIR}/src/cmake/CMakeConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}Config.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${name}
|
||||
)
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}ConfigVersion.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}ConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${name}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(add_pkgconfig_module name library include_dir depends)
|
||||
# For cmake
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/src/cmake/pkgconfig.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}.pc
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${name}.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
)
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
macro (setup_package_version_variables _packageName)
|
||||
if (DEFINED ${_packageName}_VERSION)
|
||||
string (REGEX MATCHALL "[0-9]+" _versionComponents "${${_packageName}_VERSION}")
|
||||
list (LENGTH _versionComponents _len)
|
||||
if (${_len} GREATER 0)
|
||||
list(GET _versionComponents 0 ${_packageName}_VERSION_MAJOR)
|
||||
endif()
|
||||
if (${_len} GREATER 1)
|
||||
list(GET _versionComponents 1 ${_packageName}_VERSION_MINOR)
|
||||
endif()
|
||||
if (${_len} GREATER 2)
|
||||
list(GET _versionComponents 2 ${_packageName}_VERSION_PATCH)
|
||||
endif()
|
||||
if (${_len} GREATER 3)
|
||||
list(GET _versionComponents 3 ${_packageName}_VERSION_TWEAK)
|
||||
endif()
|
||||
set (${_packageName}_VERSION_COUNT ${_len})
|
||||
message(STATUS "setup ${_packageName}_VERSION: count ${_len}, major ${${_packageName}_VERSION_MAJOR}, minor ${${_packageName}_VERSION_MINOR}, patch ${${_packageName}_VERSION_MAJOR}")
|
||||
else()
|
||||
set (${_packageName}_VERSION_COUNT 0)
|
||||
set (${_packageName}_VERSION "")
|
||||
message(WARNING "setup version: ${_packageName}_VERSION not defined")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
if(NOT DEFINED WAYLAND_PROTOCOLS_OUTPUTDIR)
|
||||
set(WAYLAND_PROTOCOLS_OUTPUTDIR ${CMAKE_BINARY_DIR}/protocols)
|
||||
file(MAKE_DIRECTORY ${WAYLAND_PROTOCOLS_OUTPUTDIR})
|
||||
message(STATUS "Create wayland protocols outputdir: ${WAYLAND_PROTOCOLS_OUTPUTDIR}")
|
||||
include_directories(${WAYLAND_PROTOCOLS_OUTPUTDIR})
|
||||
else()
|
||||
message(STATUS "Setting wayland protocols outputdir: ${WAYLAND_PROTOCOLS_OUTPUTDIR}")
|
||||
endif()
|
||||
|
||||
function(ws_generate type protocols input_file output_name)
|
||||
find_package(PkgConfig)
|
||||
pkg_get_variable(WAYLAND_PROTOCOLS ${protocols} pkgdatadir)
|
||||
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
|
||||
|
||||
if(NOT EXISTS ${input_file})
|
||||
set(input_file ${WAYLAND_PROTOCOLS}/${input_file})
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${WAYLAND_SCANNER}
|
||||
${type}-header
|
||||
${input_file}
|
||||
${WAYLAND_PROTOCOLS_OUTPUTDIR}/${output_name}.h
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${WAYLAND_SCANNER}
|
||||
public-code
|
||||
${input_file}
|
||||
${WAYLAND_PROTOCOLS_OUTPUTDIR}/${output_name}.c
|
||||
)
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
qwlroots (0.5.4) unstable; urgency=medium
|
||||
|
||||
* feat: update wlroots and nixpkgs versions for qwlroots
|
||||
* Improve the intelligence of cursor addition encapsulation
|
||||
* Add wlroots 0.19 render types and protocol support
|
||||
* fix: correct typo in build command description
|
||||
* docs: add documentation for AI development
|
||||
* chore: update gitignore for IDE environments
|
||||
* ci: pin wlroots to 0.18 for Arch Linux GitHub Actions build
|
||||
* Make the existing interface compatible with wlroots-0.19
|
||||
|
||||
-- rewine <luhongxu@deepin.org> Mon, 23 Jun 2025 17:34:11 +0800
|
||||
|
||||
qwlroots (0.5.3) unstable; urgency=medium
|
||||
|
||||
* Implement qw_idle_inhibitor_v1
|
||||
* Do not explicitly build static lib
|
||||
|
||||
-- rewine <luhongxu@deepin.org> Thu, 20 Feb 2025 17:40:48 +0800
|
||||
|
||||
qwlroots (0.5.2) unstable; urgency=medium
|
||||
|
||||
* bump version to 0.5.2
|
||||
|
||||
-- Groveer <guoyao@uniontech.com> Tue, 26 Nov 2024 18:55:56 +0800
|
||||
|
||||
qwlroots (0.5.1) unstable; urgency=medium
|
||||
|
||||
* bump version to 0.5.1
|
||||
|
||||
-- Groveer <guoyao@uniontech.com> Fri, 22 Nov 2024 18:04:26 +0800
|
||||
|
||||
qwlroots (0.5.0) unstable; urgency=medium
|
||||
|
||||
* bump version to 0.5.0
|
||||
|
||||
-- Groveer <guoyao@uniontech.com> Thu, 21 Nov 2024 16:58:34 +0800
|
||||
|
||||
qwlroots (0.4.1) UNRELEASED; urgency=medium
|
||||
|
||||
* bump version to 0.4.1
|
||||
|
||||
-- Groveer <guoyao@uniontech.com> Mon, 11 Nov 2024 18:14:56 +0800
|
||||
|
||||
qwlroots (0.0.1) UNRELEASED; urgency=medium
|
||||
|
||||
* Initial continuous release
|
||||
|
||||
-- rewine <lhongxu@outlook.com> Wed, 19 Jul 2023 03:36:12 +0000
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
Source: qwlroots
|
||||
Priority: optional
|
||||
Maintainer: rewine <lhongxu@outlook.com>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
pkg-config,
|
||||
cmake,
|
||||
ninja-build,
|
||||
qt6-base-private-dev,
|
||||
qt6-base-dev-tools,
|
||||
wayland-protocols,
|
||||
wlr-protocols,
|
||||
libwlroots-0.19-dev,
|
||||
libpixman-1-dev,
|
||||
libxcb-ewmh-dev,
|
||||
libdrm-dev
|
||||
Standards-Version: 4.6.0
|
||||
Section: libs
|
||||
Homepage: https://github.com/vioken/qwlroots.git
|
||||
#Vcs-Browser: https://salsa.debian.org/debian/qwlroots
|
||||
#Vcs-Git: https://salsa.debian.org/debian/qwlroots.git
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: qwlroots
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
${misc:Depends},
|
||||
libwlroots-0.19-dev
|
||||
Replaces: libqwlroots1
|
||||
Description: Qt and QML bindings for wlroots
|
||||
qwlroots is a binding of wlroots, which provides a Qt style development interface.
|
||||
It aims to simplify wlroots API calling methods with Qt, and serve the needs of
|
||||
calling wlroots within Qt projects.
|
||||
.
|
||||
This package contains the development headers and static library.
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system.
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
|
||||
# see FEATURE AREAS in dpkg-buildflags(1)
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
# see ENVIRONMENT in dpkg-buildflags(1)
|
||||
# package maintainers to append CFLAGS
|
||||
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
# package maintainers to append LDFLAGS
|
||||
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
|
||||
# dh_make generated override targets
|
||||
# This is example for Cmake (See https://bugs.debian.org/641051 )
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- \
|
||||
-GNinja \
|
||||
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
|
||||
|
|
@ -0,0 +1 @@
|
|||
3.0 (native)
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Compulsory line, this is a version 4 file
|
||||
version=4
|
||||
|
||||
# PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig
|
||||
#opts="pgpsigurlmangle=s%$%.sig%"
|
||||
|
||||
# GitHub hosted projects
|
||||
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%<project>-$1.tar.gz%" \
|
||||
https://github.com/vioken/qwlroots/tags \
|
||||
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{ pkgs ? import <inxpkgs> { }, wlroots_master_src ? null , nix-filter }:
|
||||
let
|
||||
mkDate = longDate: (pkgs.lib.concatStringsSep "-" [
|
||||
(builtins.substring 0 4 longDate)
|
||||
(builtins.substring 4 2 longDate)
|
||||
(builtins.substring 6 2 longDate)
|
||||
]);
|
||||
in
|
||||
rec {
|
||||
qwlroots-qt6 = pkgs.qt6.callPackage ./nix {
|
||||
inherit nix-filter;
|
||||
wlroots = pkgs.wlroots_0_19;
|
||||
};
|
||||
|
||||
qwlroots-qt5 = pkgs.libsForQt5.callPackage ./nix {
|
||||
inherit nix-filter;
|
||||
wlroots = pkgs.wlroots_0_19;
|
||||
};
|
||||
|
||||
qwlroots-qt6-wlroots18 = qwlroots-qt6.override {
|
||||
wlroots = pkgs.wlroots_0_18;
|
||||
};
|
||||
|
||||
qwlroots-qt6-clang = qwlroots-qt6.override {
|
||||
stdenv = pkgs.clangStdenv;
|
||||
};
|
||||
|
||||
default = qwlroots-qt6;
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
# qw_color_manager_v1 Usage Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The `qw_color_manager_v1` wrapper provides Qt-style bindings for wlroots' color management protocol v1 implementation. This protocol allows Wayland compositors to manage color spaces and image descriptions for surfaces.
|
||||
|
||||
## Version Requirements
|
||||
|
||||
**Important**: The color management v1 protocol is only available in wlroots 0.19.0 and later. The wrapper includes version guards to ensure compatibility:
|
||||
|
||||
```cpp
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
// Color management code here
|
||||
#endif
|
||||
```
|
||||
|
||||
## Available Classes
|
||||
|
||||
### qw_color_manager_v1
|
||||
|
||||
Main color manager class that handles the color management protocol.
|
||||
|
||||
**Static Methods:**
|
||||
- `create(wl_display *display, uint32_t version, const wlr_color_manager_v1_options *options)` - Create a new color manager instance
|
||||
|
||||
**Member Methods:**
|
||||
- `set_surface_preferred_image_description(wlr_surface *surface, const wlr_image_description_v1_data *data)` - Set preferred image description for a surface
|
||||
|
||||
### qw_image_description_v1_data
|
||||
|
||||
Utility class for working with image description data.
|
||||
|
||||
**Static Methods:**
|
||||
- `get(wlr_surface *surface)` - Get image description data from a surface
|
||||
|
||||
## Basic Usage Example
|
||||
|
||||
```cpp
|
||||
#include "types/qwcolormanagementv1.h"
|
||||
|
||||
// Check version availability
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
|
||||
void setupColorManagement(wl_display *display) {
|
||||
// Configure color manager features
|
||||
wlr_color_manager_v1_options options = {};
|
||||
options.features.icc_v2_v4 = true;
|
||||
options.features.parametric = true;
|
||||
// ... configure other features as needed
|
||||
|
||||
// Create color manager
|
||||
auto *colorManager = qw_color_manager_v1::create(display, 1, &options);
|
||||
if (!colorManager) {
|
||||
qWarning("Failed to create color manager");
|
||||
return;
|
||||
}
|
||||
|
||||
// The color manager is now ready to handle color management requests
|
||||
}
|
||||
|
||||
void setSurfaceColorSpace(wlr_surface *surface) {
|
||||
// Get current image description
|
||||
const auto *imageDesc = qw_image_description_v1_data::get(surface);
|
||||
if (imageDesc) {
|
||||
// Process image description data
|
||||
qDebug("Surface has image description with transfer function: %u",
|
||||
imageDesc->tf_named);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // WLR_VERSION_MINOR >= 19
|
||||
```
|
||||
|
||||
## Integration with Existing Code
|
||||
|
||||
The wrapper follows qwlroots patterns and integrates seamlessly with other Qt-style wlroots bindings:
|
||||
|
||||
```cpp
|
||||
// In your compositor setup
|
||||
void MyCompositor::initializeColorManagement() {
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
wlr_color_manager_v1_options options = {};
|
||||
// Configure supported features based on your hardware/renderer capabilities
|
||||
options.features.icc_v2_v4 = hasICCSupport();
|
||||
options.features.parametric = hasParametricSupport();
|
||||
|
||||
m_colorManager = qw_color_manager_v1::create(m_display->handle(), 1, &options);
|
||||
if (m_colorManager) {
|
||||
qDebug("Color management v1 protocol enabled");
|
||||
}
|
||||
#else
|
||||
qDebug("Color management v1 requires wlroots >= 0.19");
|
||||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
Always check for version compatibility and handle creation failures:
|
||||
|
||||
```cpp
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
auto *manager = qw_color_manager_v1::create(display, version, &options);
|
||||
if (!manager) {
|
||||
// Handle creation failure
|
||||
qWarning("Failed to create color manager - check options and display");
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
qWarning("Color management v1 not available in this wlroots version");
|
||||
return false;
|
||||
#endif
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
The wrapper includes comprehensive unit tests that automatically skip when the required wlroots version is not available:
|
||||
|
||||
```bash
|
||||
# Run color management tests
|
||||
ctest -R QWColorManagementV1
|
||||
|
||||
# All tests
|
||||
ctest
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [wlroots color management documentation](https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/include/wlr/types/wlr_color_management_v1.h)
|
||||
- [Wayland color management protocol specification](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/color-management/color-management-v1.xml)
|
||||
- [qwlroots wrapping patterns guide](./qwlroots-wrapping-patterns-best-practices-en.md)
|
||||
|
|
@ -0,0 +1,681 @@
|
|||
# qwlroots Wrapping Patterns Best Practices Guide
|
||||
|
||||
## Overview
|
||||
|
||||
qwlroots is a Qt-style wrapper library for wlroots C interfaces, providing multiple wrapping patterns through a macro system to accommodate different types of wlroots structures. This document summarizes the main wrapping patterns used in the project and provides guidance for adding new class wrappers.
|
||||
|
||||
## Core Design Philosophy
|
||||
|
||||
1. **Qt-style Interface**: Follows Qt specification interface style
|
||||
2. **Signal-Slot Mechanism**: Wraps wl_signal as Qt signals
|
||||
3. **Memory Management**: Automatic object lifecycle and ownership handling
|
||||
4. **Type Safety**: Uses C++ templates and concepts to ensure type safety
|
||||
5. **Zero-cost Abstraction**: Provides zero-overhead wrapping in Release mode
|
||||
|
||||
## Wrapping Pattern Classification
|
||||
|
||||
### 1. QW_CLASS_OBJECT Pattern - Complete QObject-based Wrapping
|
||||
|
||||
**Use Cases**:
|
||||
- wlroots structures contain signals (events field)
|
||||
- Need complete object lifecycle management
|
||||
- Require Qt signal-slot mechanism
|
||||
|
||||
**Features**:
|
||||
- Inherits from `qw_object<Handle, Derive>`, indirectly inherits QObject
|
||||
- Automatically connects wlroots destroy signals
|
||||
- Supports signal binding and forwarding
|
||||
- Provides complete memory management and ownership control
|
||||
|
||||
**Usage Example**:
|
||||
```cpp
|
||||
// Header file declaration
|
||||
class QW_CLASS_OBJECT(compositor)
|
||||
{
|
||||
QW_OBJECT // Required macro, provides basic functionality
|
||||
Q_OBJECT // Qt meta-object system
|
||||
|
||||
// Signal binding - converts wlroots signals to Qt signals
|
||||
QW_SIGNAL(new_surface, wlr_surface*)
|
||||
|
||||
public:
|
||||
// Static function binding - create function automatically returns qw_compositor*
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, wl_display *display, uint32_t version, wlr_renderer *renderer)
|
||||
};
|
||||
|
||||
class QW_CLASS_OBJECT(surface)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// Multiple signal bindings
|
||||
QW_SIGNAL(client_commit)
|
||||
QW_SIGNAL(commit)
|
||||
QW_SIGNAL(new_subsurface, wlr_subsurface*)
|
||||
QW_SIGNAL(map)
|
||||
QW_SIGNAL(unmap)
|
||||
|
||||
public:
|
||||
// Static functions - from/get functions
|
||||
QW_FUNC_STATIC(surface, from_resource, qw_surface *, wl_resource *resource)
|
||||
|
||||
// Member function binding
|
||||
QW_FUNC_MEMBER(surface, for_each_surface, void, wlr_surface_iterator_func_t iterator, void *user_data)
|
||||
QW_FUNC_MEMBER(surface, has_buffer, bool)
|
||||
QW_FUNC_MEMBER(surface, send_frame_done, void, const timespec *when)
|
||||
QW_FUNC_MEMBER(surface, map, void)
|
||||
QW_FUNC_MEMBER(surface, unmap, void)
|
||||
};
|
||||
```
|
||||
|
||||
**Key Macro Descriptions**:
|
||||
- `QW_OBJECT`: Provides basic object functionality, must be in protected section
|
||||
- `QW_SIGNAL(name, ...)`: Binds wlroots signals to Qt signals
|
||||
- `QW_FUNC_STATIC`: Binds static functions, create/from/get functions automatically handle return types
|
||||
- `QW_FUNC_MEMBER`: Binds member functions
|
||||
|
||||
### 2. QW_CLASS_REINTERPRET_CAST Pattern - Lightweight Type Conversion
|
||||
|
||||
**Use Cases**:
|
||||
- wlroots structures don't contain signals
|
||||
- Only need function wrapping, no object lifecycle management
|
||||
- Pursue minimal memory overhead
|
||||
|
||||
**Features**:
|
||||
- Zero-overhead wrapping based on `reinterpret_cast`
|
||||
- No additional memory allocation
|
||||
- No signal mechanism support
|
||||
- Mainly used for utility classes and simple structures
|
||||
|
||||
**Usage Example**:
|
||||
```cpp
|
||||
class QW_CLASS_REINTERPRET_CAST(client_buffer)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(client_buffer, get, qw_client_buffer *, wlr_buffer *buffer)
|
||||
};
|
||||
```
|
||||
|
||||
### 3. QW_CLASS_BOX Pattern - Value Type Wrapping
|
||||
|
||||
**Use Cases**:
|
||||
- Simple data structures
|
||||
- Need interoperability with Qt types
|
||||
- Value semantic objects
|
||||
|
||||
**Features**:
|
||||
- Contains actual data members
|
||||
- Supports conversion with Qt types
|
||||
- Value semantics, supports copy and assignment
|
||||
|
||||
**Usage Example**:
|
||||
```cpp
|
||||
class qw_box
|
||||
{
|
||||
public:
|
||||
explicit qw_box() = default;
|
||||
explicit qw_box(const wlr_box &box);
|
||||
explicit qw_box(const QRect &box);
|
||||
|
||||
QRect toQRect();
|
||||
operator wlr_box*();
|
||||
|
||||
private:
|
||||
wlr_box m_handle;
|
||||
};
|
||||
```
|
||||
|
||||
### 4. QW_CLASS_INTERFACE Pattern - Interface Implementation Wrapping
|
||||
|
||||
**Use Cases**:
|
||||
- Need to implement wlroots interfaces
|
||||
- Provide callback function implementations
|
||||
- Custom behavior extensions
|
||||
|
||||
**Features**:
|
||||
- Template-based interface binding
|
||||
- Automatic function pointer binding
|
||||
- Supports virtual function overriding
|
||||
|
||||
**Usage Example**:
|
||||
```cpp
|
||||
class QW_CLASS_INTERFACE(output)
|
||||
{
|
||||
QW_INTERFACE_INIT(output)
|
||||
|
||||
// Interface function implementations
|
||||
QW_INTERFACE(commit, bool, wlr_output_state *state)
|
||||
QW_INTERFACE(set_cursor, bool, wlr_buffer *buffer, int hotspot_x, int hotspot_y)
|
||||
|
||||
protected:
|
||||
// Implement specific interface functions
|
||||
bool commit(wlr_output_state *state);
|
||||
bool set_cursor(wlr_buffer *buffer, int hotspot_x, int hotspot_y);
|
||||
};
|
||||
```
|
||||
|
||||
## Directory Structure and File Naming Patterns
|
||||
|
||||
qwlroots' directory structure and file naming completely follow wlroots' organization, ensuring project structure consistency and maintainability.
|
||||
|
||||
### Directory Structure Correspondence
|
||||
|
||||
qwlroots' `src/` directory structure completely corresponds to wlroots' `include/wlr/` directory structure:
|
||||
|
||||
```
|
||||
wlroots/include/wlr/ qwlroots/src/
|
||||
├── types/ ←→ ├── types/
|
||||
├── util/ ←→ ├── util/
|
||||
├── render/ ←→ ├── render/
|
||||
├── interfaces/ ←→ ├── interfaces/
|
||||
├── backend/ ←→ ├── (backend-related files directly in src/)
|
||||
└── xwayland/ ←→ └── (xwayland-related files in types/)
|
||||
```
|
||||
|
||||
### File Naming Patterns
|
||||
|
||||
1. **Header File Naming**:
|
||||
- wlroots: `wlr_compositor.h` → qwlroots: `qwcompositor.h`
|
||||
- wlroots: `wlr_output.h` → qwlroots: `qwoutput.h`
|
||||
- wlroots: `wlr_buffer.h` → qwlroots: `qwbuffer.h`
|
||||
|
||||
2. **Class Name Naming**:
|
||||
- wlroots: `struct wlr_compositor` → qwlroots: `class qw_compositor`
|
||||
- wlroots: `struct wlr_surface` → qwlroots: `class qw_surface`
|
||||
|
||||
3. **Directory Classification Patterns**:
|
||||
- `types/`: Main Wayland protocol types and core objects
|
||||
- `util/`: Utility classes and helper functions
|
||||
- `render/`: Rendering-related types
|
||||
- `interfaces/`: Interface implementation-related types
|
||||
|
||||
### Method for Finding Correspondences
|
||||
|
||||
When creating wrappers for new wlroots types:
|
||||
|
||||
1. **Locate Source File**: Find the corresponding header file in `wlroots/include/wlr/`
|
||||
2. **Determine Directory**: Determine the location in qwlroots based on wlroots' directory structure
|
||||
3. **Name Conversion**: Follow the `wlr_xxx.h` → `qwxxx.h` pattern for naming
|
||||
|
||||
**Example**:
|
||||
```bash
|
||||
# File in wlroots
|
||||
wlroots/include/wlr/types/wlr_xdg_shell.h
|
||||
|
||||
# Corresponding qwlroots file should be
|
||||
qwlroots/src/types/qwxdgshell.h
|
||||
```
|
||||
|
||||
## Complete Workflow for Adding New Wrappers
|
||||
|
||||
When users request "add xxx class" or "add xxxx function", follow this workflow:
|
||||
|
||||
### Step 0: Update wlroots Submodule
|
||||
|
||||
Before starting any wrapping work, ensure the wlroots submodule is up to date:
|
||||
|
||||
```bash
|
||||
# Enter wlroots submodule directory
|
||||
cd wlroots
|
||||
|
||||
# Fetch latest tags and commits
|
||||
git fetch --tags
|
||||
|
||||
# View latest version tags
|
||||
git tag --sort=-version:refname | head -5
|
||||
|
||||
# Checkout to latest stable version (e.g., 0.19.0)
|
||||
git checkout 0.19.0
|
||||
|
||||
# Return to project root
|
||||
cd ..
|
||||
|
||||
# Commit submodule update
|
||||
git add wlroots
|
||||
git commit -m "submodule: update wlroots to latest version"
|
||||
```
|
||||
|
||||
### Step 1: Locate Target Type in wlroots Submodule
|
||||
|
||||
Use the following methods to locate the type to be wrapped in the wlroots submodule:
|
||||
|
||||
```bash
|
||||
# Find specific header files
|
||||
find wlroots/include/wlr -name "*target_name*" -type f
|
||||
|
||||
# Search for struct definitions
|
||||
grep -r "struct wlr_target_name" wlroots/include/wlr/
|
||||
|
||||
# View specific file content
|
||||
cat wlroots/include/wlr/types/wlr_target_name.h
|
||||
```
|
||||
|
||||
### Step 2: Determine Version Information
|
||||
|
||||
Find out which version introduced this type:
|
||||
|
||||
```bash
|
||||
# View file commit history in wlroots directory
|
||||
cd wlroots
|
||||
git log --oneline --follow include/wlr/types/wlr_target_name.h
|
||||
|
||||
# View detailed information of specific commit
|
||||
git show commit_hash
|
||||
|
||||
# Find earliest tag containing this commit
|
||||
git tag --contains commit_hash --sort=version:refname | head -1
|
||||
```
|
||||
|
||||
This information will be used to add version compatibility macros in qwlroots.
|
||||
|
||||
### Step 3: Analyze wlroots Structure
|
||||
|
||||
1. **Check for events field**:
|
||||
- Has events field → Use `QW_CLASS_OBJECT`
|
||||
- No events field → Use `QW_CLASS_REINTERPRET_CAST`
|
||||
|
||||
2. **Check if interface implementation is needed**:
|
||||
- Need callback implementation → Use `QW_CLASS_INTERFACE`
|
||||
|
||||
3. **Check if it's a simple data structure**:
|
||||
- Simple data structure → Consider custom wrapping or `QW_CLASS_BOX`
|
||||
|
||||
### Step 2: Determine File Location and Naming
|
||||
|
||||
Determine the corresponding qwlroots file location based on the wlroots source file location:
|
||||
|
||||
```bash
|
||||
# 1. Find the source file in wlroots
|
||||
find /path/to/wlroots/include/wlr -name "wlr_example.h"
|
||||
# Example: wlroots/include/wlr/types/wlr_example.h
|
||||
|
||||
# 2. Determine corresponding location in qwlroots
|
||||
# src/types/qwexample.h
|
||||
```
|
||||
|
||||
### Step 3: Create Header File
|
||||
|
||||
```cpp
|
||||
// File: src/types/qwexample.h
|
||||
#pragma once
|
||||
|
||||
#include <qwobject.h>
|
||||
|
||||
extern "C" {
|
||||
#include <wlr/types/wlr_example.h>
|
||||
}
|
||||
|
||||
QW_BEGIN_NAMESPACE
|
||||
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// Bind all related signals
|
||||
QW_SIGNAL(signal_name, param_type)
|
||||
|
||||
public:
|
||||
// Bind static functions
|
||||
QW_FUNC_STATIC(example, create, qw_example *, param_type param)
|
||||
QW_FUNC_STATIC(example, from_resource, qw_example *, wl_resource *resource)
|
||||
|
||||
// Bind member functions
|
||||
QW_FUNC_MEMBER(example, method_name, return_type, param_type param)
|
||||
|
||||
// If there's a destroy method, destructor should be protected
|
||||
protected:
|
||||
QW_FUNC_MEMBER(example, destroy, void)
|
||||
};
|
||||
|
||||
QW_END_NAMESPACE
|
||||
```
|
||||
|
||||
### Step 4: Handle Version Compatibility
|
||||
|
||||
```cpp
|
||||
// Handle API differences between different wlroots versions
|
||||
#if WLR_VERSION_MINOR < 18
|
||||
QW_SIGNAL(old_signal, param_type)
|
||||
#else
|
||||
QW_SIGNAL(new_signal, param_type)
|
||||
#endif
|
||||
|
||||
#if WLR_VERSION_MINOR < 19
|
||||
QW_FUNC_MEMBER(example, old_method, void, param_type)
|
||||
#else
|
||||
QW_FUNC_MEMBER(example, new_method, void, param_type)
|
||||
#endif
|
||||
```
|
||||
|
||||
### Step 5: Add to Build System
|
||||
|
||||
Add the new header file to `src/CMakeLists.txt`:
|
||||
|
||||
```cmake
|
||||
set(HEADERS
|
||||
# ... other header files
|
||||
types/qwexample.h
|
||||
)
|
||||
```
|
||||
|
||||
## Best Practices and Considerations
|
||||
|
||||
### 1. Naming Conventions
|
||||
|
||||
- Class names: `qw_` + wlroots type name (remove `wlr_` prefix)
|
||||
- Signal names: `notify_` + original signal name
|
||||
- Function names: Keep consistent with wlroots function names (remove type prefix)
|
||||
|
||||
### 2. Signal Handling
|
||||
|
||||
```cpp
|
||||
// Correct signal binding
|
||||
QW_SIGNAL(destroy) // Automatically handled, no manual binding needed
|
||||
QW_SIGNAL(custom_event, param_type) // Custom signals
|
||||
|
||||
// Signal connection example
|
||||
connect(surface, &qw_surface::notify_commit, this, [](){
|
||||
// Handle commit event
|
||||
});
|
||||
```
|
||||
|
||||
### 3. Memory Management
|
||||
|
||||
```cpp
|
||||
// Create object (owns ownership)
|
||||
auto *compositor = qw_compositor::create(display, version, renderer);
|
||||
|
||||
// Get object from existing handle (doesn't own ownership)
|
||||
auto *surface = qw_surface::from(wlr_surface);
|
||||
|
||||
// Check if object exists
|
||||
auto *existing = qw_surface::get(wlr_surface); // May return nullptr
|
||||
```
|
||||
|
||||
### 4. Function Binding Principles
|
||||
|
||||
#### 4.1 Determining Function Ownership and Placement
|
||||
|
||||
When wrapping wlroots functions, it's crucial to determine whether a function should be a static function or a member function, and which class it belongs to. Follow this systematic approach:
|
||||
|
||||
**Function Name Analysis Pattern:**
|
||||
wlroots functions follow the pattern: `wlr_<type>_<function_name>`
|
||||
|
||||
**Step 1: Parse the Function Name**
|
||||
- Split the function name at underscores after `wlr_`
|
||||
- Identify the type part and function name part
|
||||
- The type part should correspond to an existing wlroots type
|
||||
|
||||
**Example Analysis:**
|
||||
```cpp
|
||||
// Function: wlr_surface_get_image_description_v1_data
|
||||
// Parsing: wlr_ + surface + _ + get_image_description_v1_data
|
||||
// Type: wlr_surface
|
||||
// Function name: get_image_description_v1_data
|
||||
|
||||
// Why not wlr_surface_get?
|
||||
// Because wlr_surface_get is not a valid wlroots type
|
||||
// get_image_description_v1_data is a more reasonable function name
|
||||
```
|
||||
|
||||
**Step 2: Verify Type Existence**
|
||||
- Check if `wlr_<type>` exists as a structure in wlroots headers
|
||||
- If the type exists, this confirms the parsing is correct
|
||||
|
||||
**Step 3: Determine Static vs Member Function**
|
||||
- **Member Function**: First parameter type matches the parsed type
|
||||
```cpp
|
||||
// wlr_surface_get_image_description_v1_data(struct wlr_surface *surface)
|
||||
// First parameter is wlr_surface* → Member function of qw_surface
|
||||
QW_FUNC_MEMBER(surface, get_image_description_v1_data, const wlr_image_description_v1_data *)
|
||||
```
|
||||
|
||||
- **Static Function**: First parameter type doesn't match the parsed type
|
||||
```cpp
|
||||
// wlr_compositor_create(wl_display *display, ...)
|
||||
// First parameter is wl_display*, not wlr_compositor* → Static function
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, wl_display *display, ...)
|
||||
```
|
||||
|
||||
**Step 4: Handle Cross-File Functions**
|
||||
Functions may be defined in different header files than their target type. This is common in wlroots:
|
||||
|
||||
```cpp
|
||||
// wlr_surface_get_image_description_v1_data is defined in wlr_color_management_v1.h
|
||||
// but operates on wlr_surface, so it belongs to qw_surface class
|
||||
|
||||
// In qwcompositor.h:
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
#include <wlr/types/wlr_color_management_v1.h>
|
||||
#endif
|
||||
|
||||
class QW_CLASS_OBJECT(surface) {
|
||||
// ...
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
QW_FUNC_MEMBER(surface, get_image_description_v1_data, const wlr_image_description_v1_data *)
|
||||
#endif
|
||||
};
|
||||
```
|
||||
|
||||
**Common Patterns:**
|
||||
```cpp
|
||||
// Create functions - always static, return the type
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, ...)
|
||||
|
||||
// From/Get functions - usually static, return the type
|
||||
QW_FUNC_STATIC(surface, from_resource, qw_surface *, wl_resource *resource)
|
||||
|
||||
// Instance methods - member functions, first param matches type
|
||||
QW_FUNC_MEMBER(surface, has_buffer, bool)
|
||||
QW_FUNC_MEMBER(surface, send_frame_done, void, const timespec *when)
|
||||
|
||||
// Utility functions - check first parameter to determine placement
|
||||
// If first param is wlr_surface* → member of qw_surface
|
||||
// If first param is something else → static function or belongs to other class
|
||||
```
|
||||
|
||||
#### 4.2 Function Binding Syntax
|
||||
|
||||
```cpp
|
||||
// Static function binding
|
||||
QW_FUNC_STATIC(type, create, qw_type *, ...) // Create function, same type returns qw_*
|
||||
QW_FUNC_STATIC(type, from, qw_type *, ...) // Conversion function, same type returns qw_*
|
||||
QW_FUNC_STATIC(type, get, qw_type *, ...) // Get function, same type returns qw_*
|
||||
QW_FUNC_STATIC(type, get_other, wlr_other *, ...) // Get other types, keep wlr_*
|
||||
QW_FUNC_STATIC(type, utility, return_type, ...) // Utility function, by actual return type
|
||||
|
||||
// Member function binding
|
||||
QW_FUNC_MEMBER(type, method, return_type, ...) // Instance method, return type by actual situation
|
||||
```
|
||||
|
||||
### 5. Error Handling
|
||||
|
||||
```cpp
|
||||
// Check object validity
|
||||
if (!surface->is_valid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Safe handle access
|
||||
if (auto *handle = surface->handle()) {
|
||||
// Use handle
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Version Compatibility Handling
|
||||
|
||||
- Use conditional compilation to handle API changes
|
||||
- Prioritize supporting the latest version API
|
||||
- Provide compatibility macros for older versions
|
||||
|
||||
### 7. Testing
|
||||
|
||||
Create tests for new wrapper classes:
|
||||
|
||||
```cpp
|
||||
// tests/test_qwexample.cpp
|
||||
#include "qwexample.h"
|
||||
#include <QtTest>
|
||||
|
||||
class TestQwExample : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void testCreate();
|
||||
void testSignals();
|
||||
void testMethods();
|
||||
};
|
||||
```
|
||||
|
||||
## Common Issues and Solutions
|
||||
|
||||
### 1. Compilation Error: wlroots Function Not Found
|
||||
|
||||
**Problem**: Compilation fails when using `QW_FUNC_STATIC` or `QW_FUNC_MEMBER`.
|
||||
|
||||
**Solution**:
|
||||
- Check wlroots version compatibility
|
||||
- Confirm function name spelling is correct
|
||||
- Use conditional compilation to handle version differences
|
||||
|
||||
### 2. Signal Connection Failure
|
||||
|
||||
**Problem**: Qt signals don't trigger properly.
|
||||
|
||||
**Solution**:
|
||||
- Ensure `QW_OBJECT` and `Q_OBJECT` macros are used
|
||||
- Check signal parameter types are correct
|
||||
- Verify wlroots structure actually has corresponding signals
|
||||
|
||||
### 3. Memory Leaks or Crashes
|
||||
|
||||
**Problem**: Issues occur during object destruction.
|
||||
|
||||
**Solution**:
|
||||
- Handle object ownership correctly
|
||||
- For classes with destroy methods, make destructor protected
|
||||
- Use smart pointers to manage lifecycle
|
||||
|
||||
## Common Wrapping Errors Based on PR #322
|
||||
|
||||
Based on actual code review experience, here are common mistakes developers make when adding new wrappers:
|
||||
|
||||
### 4. Incorrect Interface Type Wrapping
|
||||
|
||||
**Problem**: Incorrectly attempting to wrap interface-related init functions.
|
||||
|
||||
**Solution**:
|
||||
- init interfaces are for interface use, not wrapped in regular classes
|
||||
- Should wrap corresponding interface types, such as `qw_allocator_interface`
|
||||
- Interface-related wrapping usually needs separate handling
|
||||
|
||||
### 5. Static Function Return Type Errors
|
||||
|
||||
**Problem**: Static function return type uses `wlr_*` type instead of `qw_*` type when the return type matches the current wrapped class type.
|
||||
|
||||
**❌ Incorrect Example**:
|
||||
```cpp
|
||||
// In qw_color_transform class
|
||||
QW_FUNC_STATIC(color_transform, create, wlr_color_transform *, ...) // Error: should return qw_color_transform*
|
||||
|
||||
// In qw_abc class
|
||||
QW_FUNC_STATIC(abc, create, wlr_abc *, ...) // Error: should return qw_abc*
|
||||
QW_FUNC_STATIC(abc, get_xxx_data, wlr_xxx *, ...) // Correct: other types remain unchanged
|
||||
```
|
||||
|
||||
**✅ Correct Format**:
|
||||
```cpp
|
||||
// In qw_color_transform class
|
||||
QW_FUNC_STATIC(color_transform, create, qw_color_transform *, ...) // Correct: same type returns qw_*
|
||||
|
||||
// In qw_abc class
|
||||
QW_FUNC_STATIC(abc, create, qw_abc *, ...) // Correct: same type returns qw_*
|
||||
QW_FUNC_STATIC(abc, get_xxx_data, wlr_xxx *, ...) // Correct: other types keep wlr_*
|
||||
```
|
||||
|
||||
**Solution**:
|
||||
- Only when the static function's return type matches the currently wrapped class type, change `wlr_*` to `qw_*`
|
||||
- If returning other types (like `wlr_xxx *`), keep the original `wlr_*` type
|
||||
- This ensures wrapping consistency: same type returns wrapped type, other types keep original type
|
||||
|
||||
### 6. Redundant Destroy Signal Declaration
|
||||
|
||||
**Problem**: Manually declaring destroy signal in `QW_CLASS_OBJECT` class.
|
||||
|
||||
**❌ Incorrect Example**:
|
||||
```cpp
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
QW_SIGNAL(destroy) // Redundant: base class handles automatically
|
||||
};
|
||||
```
|
||||
|
||||
**✅ Correct Format**:
|
||||
```cpp
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// destroy signal is handled automatically by base class, no explicit declaration needed
|
||||
// Only declare specific business signals
|
||||
QW_SIGNAL(custom_event, param_type)
|
||||
};
|
||||
```
|
||||
|
||||
**Solution**:
|
||||
- destroy signal is specially handled in `QW_CLASS_OBJECT`, no manual declaration needed
|
||||
- Only declare specific business signals
|
||||
|
||||
### 7. Type Mixing Wrapping Errors
|
||||
|
||||
**Problem**: Mixing functions of different types in one class.
|
||||
|
||||
**❌ Incorrect Example**:
|
||||
```cpp
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_manager_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_manager_v1, create, ...)
|
||||
// Error: wrapping syncobj_v1 type functions in manager class
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_v1, get_surface_state, ...)
|
||||
};
|
||||
```
|
||||
|
||||
**✅ Correct Design**:
|
||||
```cpp
|
||||
// Separate different types
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_manager_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_manager_v1, create, ...)
|
||||
};
|
||||
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_v1, get_surface_state, ...)
|
||||
};
|
||||
```
|
||||
|
||||
**Solution**:
|
||||
- Should not wrap `linux_drm_syncobj_v1` type functions in `qw_linux_drm_syncobj_manager_v1`
|
||||
- Each class should only wrap functions belonging to its own type
|
||||
- Functions of different types should be separated into corresponding classes
|
||||
|
||||
## Summary
|
||||
|
||||
qwlroots' wrapping pattern design is sophisticated, providing flexible and efficient C++ wrapping through template and macro systems. When adding new class wrappers, you should:
|
||||
|
||||
1. Carefully analyze wlroots structure characteristics
|
||||
2. Choose appropriate wrapping patterns
|
||||
3. Follow project naming and coding conventions
|
||||
4. Handle version compatibility issues
|
||||
5. Write corresponding test code
|
||||
|
||||
By following these best practices, you can ensure that newly added wrapper classes remain consistent with the overall project architecture and provide a good development experience.
|
||||
|
|
@ -0,0 +1,681 @@
|
|||
# qwlroots 封装模式最佳实践指南
|
||||
|
||||
## 概述
|
||||
|
||||
qwlroots 是对 wlroots C 接口的 Qt 风格封装库,通过宏系统提供了多种封装模式来适应不同类型的 wlroots 结构体。本文档总结了项目中使用的几种主要封装模式,为添加新的类封装提供指导。
|
||||
|
||||
## 核心设计理念
|
||||
|
||||
1. **Qt 风格接口**:遵循 Qt 规范的接口风格
|
||||
2. **信号槽机制**:将 wl_signal 封装为 Qt 信号
|
||||
3. **内存管理**:自动处理对象生命周期和所有权
|
||||
4. **类型安全**:利用 C++ 模板和概念确保类型安全
|
||||
5. **零开销抽象**:在 Release 模式下提供零开销的封装
|
||||
|
||||
## 封装模式分类
|
||||
|
||||
### 1. QW_CLASS_OBJECT 模式 - 基于 QObject 的完整封装
|
||||
|
||||
**适用场景**:
|
||||
- wlroots 结构体包含信号(events 字段)
|
||||
- 需要完整的对象生命周期管理
|
||||
- 需要 Qt 信号槽机制
|
||||
|
||||
**特点**:
|
||||
- 继承自 `qw_object<Handle, Derive>`,间接继承 QObject
|
||||
- 自动连接 wlroots 的 destroy 信号
|
||||
- 支持信号绑定和转发
|
||||
- 提供完整的内存管理和所有权控制
|
||||
|
||||
**使用示例**:
|
||||
```cpp
|
||||
// 头文件声明
|
||||
class QW_CLASS_OBJECT(compositor)
|
||||
{
|
||||
QW_OBJECT // 必需的宏,提供基础功能
|
||||
Q_OBJECT // Qt 元对象系统
|
||||
|
||||
// 信号绑定 - 将 wlroots 信号转换为 Qt 信号
|
||||
QW_SIGNAL(new_surface, wlr_surface*)
|
||||
|
||||
public:
|
||||
// 静态函数绑定 - create 函数自动返回 qw_compositor*
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, wl_display *display, uint32_t version, wlr_renderer *renderer)
|
||||
};
|
||||
|
||||
class QW_CLASS_OBJECT(surface)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// 多个信号绑定
|
||||
QW_SIGNAL(client_commit)
|
||||
QW_SIGNAL(commit)
|
||||
QW_SIGNAL(new_subsurface, wlr_subsurface*)
|
||||
QW_SIGNAL(map)
|
||||
QW_SIGNAL(unmap)
|
||||
|
||||
public:
|
||||
// 静态函数 - from/get 函数
|
||||
QW_FUNC_STATIC(surface, from_resource, qw_surface *, wl_resource *resource)
|
||||
|
||||
// 成员函数绑定
|
||||
QW_FUNC_MEMBER(surface, for_each_surface, void, wlr_surface_iterator_func_t iterator, void *user_data)
|
||||
QW_FUNC_MEMBER(surface, has_buffer, bool)
|
||||
QW_FUNC_MEMBER(surface, send_frame_done, void, const timespec *when)
|
||||
QW_FUNC_MEMBER(surface, map, void)
|
||||
QW_FUNC_MEMBER(surface, unmap, void)
|
||||
};
|
||||
```
|
||||
|
||||
**关键宏说明**:
|
||||
- `QW_OBJECT`:提供基础的对象功能,必须在 protected 区域
|
||||
- `QW_SIGNAL(name, ...)`:绑定 wlroots 信号到 Qt 信号
|
||||
- `QW_FUNC_STATIC`:绑定静态函数,create/from/get 函数自动处理返回类型
|
||||
- `QW_FUNC_MEMBER`:绑定成员函数
|
||||
|
||||
### 2. QW_CLASS_REINTERPRET_CAST 模式 - 轻量级类型转换
|
||||
|
||||
**适用场景**:
|
||||
- wlroots 结构体不包含信号
|
||||
- 只需要函数封装,不需要对象生命周期管理
|
||||
- 追求最小内存开销
|
||||
|
||||
**特点**:
|
||||
- 基于 `reinterpret_cast` 的零开销封装
|
||||
- 不分配额外内存
|
||||
- 不支持信号机制
|
||||
- 主要用于工具类和简单结构体
|
||||
|
||||
**使用示例**:
|
||||
```cpp
|
||||
class QW_CLASS_REINTERPRET_CAST(client_buffer)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(client_buffer, get, qw_client_buffer *, wlr_buffer *buffer)
|
||||
};
|
||||
```
|
||||
|
||||
### 3. QW_CLASS_BOX 模式 - 值类型封装
|
||||
|
||||
**适用场景**:
|
||||
- 简单的数据结构
|
||||
- 需要与 Qt 类型互操作
|
||||
- 值语义的对象
|
||||
|
||||
**特点**:
|
||||
- 包含实际的数据成员
|
||||
- 支持与 Qt 类型的转换
|
||||
- 值语义,支持拷贝和赋值
|
||||
|
||||
**使用示例**:
|
||||
```cpp
|
||||
class qw_box
|
||||
{
|
||||
public:
|
||||
explicit qw_box() = default;
|
||||
explicit qw_box(const wlr_box &box);
|
||||
explicit qw_box(const QRect &box);
|
||||
|
||||
QRect toQRect();
|
||||
operator wlr_box*();
|
||||
|
||||
private:
|
||||
wlr_box m_handle;
|
||||
};
|
||||
```
|
||||
|
||||
### 4. QW_CLASS_INTERFACE 模式 - 接口实现封装
|
||||
|
||||
**适用场景**:
|
||||
- 需要实现 wlroots 接口
|
||||
- 提供回调函数实现
|
||||
- 自定义行为扩展
|
||||
|
||||
**特点**:
|
||||
- 基于模板的接口绑定
|
||||
- 自动处理函数指针绑定
|
||||
- 支持虚函数重写
|
||||
|
||||
**使用示例**:
|
||||
```cpp
|
||||
class QW_CLASS_INTERFACE(output)
|
||||
{
|
||||
QW_INTERFACE_INIT(output)
|
||||
|
||||
// 接口函数实现
|
||||
QW_INTERFACE(commit, bool, wlr_output_state *state)
|
||||
QW_INTERFACE(set_cursor, bool, wlr_buffer *buffer, int hotspot_x, int hotspot_y)
|
||||
|
||||
protected:
|
||||
// 实现具体的接口函数
|
||||
bool commit(wlr_output_state *state);
|
||||
bool set_cursor(wlr_buffer *buffer, int hotspot_x, int hotspot_y);
|
||||
};
|
||||
```
|
||||
|
||||
## 目录结构和文件命名规律
|
||||
|
||||
qwlroots 的目录结构和文件命名完全遵循 wlroots 的组织方式,这确保了项目结构的一致性和可维护性。
|
||||
|
||||
### 目录结构对应关系
|
||||
|
||||
qwlroots 的 `src/` 目录结构与 wlroots 的 `include/wlr/` 目录结构完全对应:
|
||||
|
||||
```
|
||||
wlroots/include/wlr/ qwlroots/src/
|
||||
├── types/ ←→ ├── types/
|
||||
├── util/ ←→ ├── util/
|
||||
├── render/ ←→ ├── render/
|
||||
├── interfaces/ ←→ ├── interfaces/
|
||||
├── backend/ ←→ ├── (backend相关文件直接在src/)
|
||||
└── xwayland/ ←→ └── (xwayland相关文件在types/)
|
||||
```
|
||||
|
||||
### 文件命名规律
|
||||
|
||||
1. **头文件命名**:
|
||||
- wlroots: `wlr_compositor.h` → qwlroots: `qwcompositor.h`
|
||||
- wlroots: `wlr_output.h` → qwlroots: `qwoutput.h`
|
||||
- wlroots: `wlr_buffer.h` → qwlroots: `qwbuffer.h`
|
||||
|
||||
2. **类名命名**:
|
||||
- wlroots: `struct wlr_compositor` → qwlroots: `class qw_compositor`
|
||||
- wlroots: `struct wlr_surface` → qwlroots: `class qw_surface`
|
||||
|
||||
3. **目录分类规律**:
|
||||
- `types/`: 主要的 Wayland 协议类型和核心对象
|
||||
- `util/`: 工具类和辅助函数
|
||||
- `render/`: 渲染相关的类型
|
||||
- `interfaces/`: 接口实现相关的类型
|
||||
|
||||
### 查找对应关系的方法
|
||||
|
||||
当需要为新的 wlroots 类型创建封装时:
|
||||
|
||||
1. **定位源文件**:在 `wlroots/include/wlr/` 中找到对应的头文件
|
||||
2. **确定目录**:根据 wlroots 的目录结构确定在 qwlroots 中的位置
|
||||
3. **命名转换**:按照 `wlr_xxx.h` → `qwxxx.h` 的规律命名
|
||||
|
||||
**示例**:
|
||||
```bash
|
||||
# wlroots 中的文件
|
||||
wlroots/include/wlr/types/wlr_xdg_shell.h
|
||||
|
||||
# 对应的 qwlroots 文件应该是
|
||||
qwlroots/src/types/qwxdgshell.h
|
||||
```
|
||||
|
||||
## 新增封装的完整操作流程
|
||||
|
||||
当用户请求"新增xxx类"或"新增xxxx函数"时,应按照以下流程操作:
|
||||
|
||||
### 步骤 0:更新 wlroots 子模块
|
||||
|
||||
在开始任何封装工作之前,首先确保 wlroots 子模块是最新的:
|
||||
|
||||
```bash
|
||||
# 进入 wlroots 子模块目录
|
||||
cd wlroots
|
||||
|
||||
# 获取最新的标签和提交
|
||||
git fetch --tags
|
||||
|
||||
# 查看最新的版本标签
|
||||
git tag --sort=-version:refname | head -5
|
||||
|
||||
# 切换到最新的稳定版本(例如 0.19.0)
|
||||
git checkout 0.19.0
|
||||
|
||||
# 返回项目根目录
|
||||
cd ..
|
||||
|
||||
# 提交子模块更新
|
||||
git add wlroots
|
||||
git commit -m "submodule: update wlroots to latest version"
|
||||
```
|
||||
|
||||
### 步骤 1:在 wlroots 子模块中查找目标类型
|
||||
|
||||
使用以下方法在 wlroots 子模块中定位要封装的类型:
|
||||
|
||||
```bash
|
||||
# 查找特定的头文件
|
||||
find wlroots/include/wlr -name "*目标名称*" -type f
|
||||
|
||||
# 搜索结构体定义
|
||||
grep -r "struct wlr_目标名称" wlroots/include/wlr/
|
||||
|
||||
# 查看具体文件内容
|
||||
cat wlroots/include/wlr/types/wlr_目标名称.h
|
||||
```
|
||||
|
||||
### 步骤 2:确定版本信息
|
||||
|
||||
查找该类型是在哪个版本中引入的:
|
||||
|
||||
```bash
|
||||
# 在 wlroots 目录中查看文件的提交历史
|
||||
cd wlroots
|
||||
git log --oneline --follow include/wlr/types/wlr_目标名称.h
|
||||
|
||||
# 查看特定提交的详细信息
|
||||
git show 提交哈希
|
||||
|
||||
# 查找包含该提交的最早标签
|
||||
git tag --contains 提交哈希 --sort=version:refname | head -1
|
||||
```
|
||||
|
||||
这个信息将用于在 qwlroots 中添加版本兼容性宏。
|
||||
|
||||
### 步骤 3:分析 wlroots 结构体
|
||||
|
||||
1. **检查是否有 events 字段**:
|
||||
- 有 events 字段 → 使用 `QW_CLASS_OBJECT`
|
||||
- 无 events 字段 → 使用 `QW_CLASS_REINTERPRET_CAST`
|
||||
|
||||
2. **检查是否需要接口实现**:
|
||||
- 需要实现回调 → 使用 `QW_CLASS_INTERFACE`
|
||||
|
||||
3. **检查是否为简单数据结构**:
|
||||
- 简单数据结构 → 考虑自定义封装或 `QW_CLASS_BOX`
|
||||
|
||||
### 步骤 2:确定文件位置和命名
|
||||
|
||||
根据 wlroots 源文件的位置确定对应的 qwlroots 文件位置:
|
||||
|
||||
```bash
|
||||
# 1. 找到 wlroots 中的源文件
|
||||
find /path/to/wlroots/include/wlr -name "wlr_example.h"
|
||||
# 例如:wlroots/include/wlr/types/wlr_example.h
|
||||
|
||||
# 2. 确定 qwlroots 中的对应位置
|
||||
# src/types/qwexample.h
|
||||
```
|
||||
|
||||
### 步骤 3:创建头文件
|
||||
|
||||
```cpp
|
||||
// 文件:src/types/qwexample.h
|
||||
#pragma once
|
||||
|
||||
#include <qwobject.h>
|
||||
|
||||
extern "C" {
|
||||
#include <wlr/types/wlr_example.h>
|
||||
}
|
||||
|
||||
QW_BEGIN_NAMESPACE
|
||||
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// 绑定所有相关信号
|
||||
QW_SIGNAL(signal_name, param_type)
|
||||
|
||||
public:
|
||||
// 绑定静态函数
|
||||
QW_FUNC_STATIC(example, create, qw_example *, param_type param)
|
||||
QW_FUNC_STATIC(example, from_resource, qw_example *, wl_resource *resource)
|
||||
|
||||
// 绑定成员函数
|
||||
QW_FUNC_MEMBER(example, method_name, return_type, param_type param)
|
||||
|
||||
// 如果有 destroy 方法,析构函数应该是 protected
|
||||
protected:
|
||||
QW_FUNC_MEMBER(example, destroy, void)
|
||||
};
|
||||
|
||||
QW_END_NAMESPACE
|
||||
```
|
||||
|
||||
### 步骤 4:处理版本兼容性
|
||||
|
||||
```cpp
|
||||
// 处理不同 wlroots 版本的 API 差异
|
||||
#if WLR_VERSION_MINOR < 18
|
||||
QW_SIGNAL(old_signal, param_type)
|
||||
#else
|
||||
QW_SIGNAL(new_signal, param_type)
|
||||
#endif
|
||||
|
||||
#if WLR_VERSION_MINOR < 19
|
||||
QW_FUNC_MEMBER(example, old_method, void, param_type)
|
||||
#else
|
||||
QW_FUNC_MEMBER(example, new_method, void, param_type)
|
||||
#endif
|
||||
```
|
||||
|
||||
### 步骤 5:添加到构建系统
|
||||
|
||||
在 `src/CMakeLists.txt` 中添加新的头文件:
|
||||
|
||||
```cmake
|
||||
set(HEADERS
|
||||
# ... 其他头文件
|
||||
types/qwexample.h
|
||||
)
|
||||
```
|
||||
|
||||
## 最佳实践和注意事项
|
||||
|
||||
### 1. 命名规范
|
||||
|
||||
- 类名:`qw_` + wlroots 类型名(去掉 `wlr_` 前缀)
|
||||
- 信号名:`notify_` + 原始信号名
|
||||
- 函数名:保持与 wlroots 函数名一致(去掉类型前缀)
|
||||
|
||||
### 2. 信号处理
|
||||
|
||||
```cpp
|
||||
// 正确的信号绑定
|
||||
QW_SIGNAL(destroy) // 自动处理,无需手动绑定
|
||||
QW_SIGNAL(custom_event, param_type) // 自定义信号
|
||||
|
||||
// 信号连接示例
|
||||
connect(surface, &qw_surface::notify_commit, this, [](){
|
||||
// 处理提交事件
|
||||
});
|
||||
```
|
||||
|
||||
### 3. 内存管理
|
||||
|
||||
```cpp
|
||||
// 创建对象(拥有所有权)
|
||||
auto *compositor = qw_compositor::create(display, version, renderer);
|
||||
|
||||
// 从现有句柄获取对象(不拥有所有权)
|
||||
auto *surface = qw_surface::from(wlr_surface);
|
||||
|
||||
// 检查对象是否存在
|
||||
auto *existing = qw_surface::get(wlr_surface); // 可能返回 nullptr
|
||||
```
|
||||
|
||||
### 4. 函数绑定原则
|
||||
|
||||
#### 4.1 确定函数所有权和放置位置
|
||||
|
||||
在封装 wlroots 函数时,确定函数应该是静态函数还是成员函数,以及它属于哪个类是至关重要的。遵循以下系统性方法:
|
||||
|
||||
**函数命名分析模式:**
|
||||
wlroots 函数遵循模式:`wlr_<类型>_<函数名>`
|
||||
|
||||
**步骤 1:解析函数名**
|
||||
- 在 `wlr_` 后按下划线分割函数名
|
||||
- 识别类型部分和函数名部分
|
||||
- 类型部分应该对应一个现有的 wlroots 类型
|
||||
|
||||
**示例分析:**
|
||||
```cpp
|
||||
// 函数:wlr_surface_get_image_description_v1_data
|
||||
// 解析:wlr_ + surface + _ + get_image_description_v1_data
|
||||
// 类型:wlr_surface
|
||||
// 函数名:get_image_description_v1_data
|
||||
|
||||
// 为什么不是 wlr_surface_get?
|
||||
// 因为 wlr_surface_get 不是一个有效的 wlroots 类型
|
||||
// get_image_description_v1_data 是一个更合理的函数名
|
||||
```
|
||||
|
||||
**步骤 2:验证类型存在性**
|
||||
- 检查 `wlr_<类型>` 是否作为结构体存在于 wlroots 头文件中
|
||||
- 如果类型存在,这确认了解析是正确的
|
||||
|
||||
**步骤 3:确定静态函数 vs 成员函数**
|
||||
- **成员函数**:第一个参数类型与解析出的类型匹配
|
||||
```cpp
|
||||
// wlr_surface_get_image_description_v1_data(struct wlr_surface *surface)
|
||||
// 第一个参数是 wlr_surface* → qw_surface 的成员函数
|
||||
QW_FUNC_MEMBER(surface, get_image_description_v1_data, const wlr_image_description_v1_data *)
|
||||
```
|
||||
|
||||
- **静态函数**:第一个参数类型与解析出的类型不匹配
|
||||
```cpp
|
||||
// wlr_compositor_create(wl_display *display, ...)
|
||||
// 第一个参数是 wl_display*,不是 wlr_compositor* → 静态函数
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, wl_display *display, ...)
|
||||
```
|
||||
|
||||
**步骤 4:处理跨文件函数**
|
||||
函数可能定义在与其目标类型不同的头文件中。这在 wlroots 中很常见:
|
||||
|
||||
```cpp
|
||||
// wlr_surface_get_image_description_v1_data 定义在 wlr_color_management_v1.h 中
|
||||
// 但操作 wlr_surface,所以它属于 qw_surface 类
|
||||
|
||||
// 在 qwcompositor.h 中:
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
#include <wlr/types/wlr_color_management_v1.h>
|
||||
#endif
|
||||
|
||||
class QW_CLASS_OBJECT(surface) {
|
||||
// ...
|
||||
#if WLR_VERSION_MINOR >= 19
|
||||
QW_FUNC_MEMBER(surface, get_image_description_v1_data, const wlr_image_description_v1_data *)
|
||||
#endif
|
||||
};
|
||||
```
|
||||
|
||||
**常见模式:**
|
||||
```cpp
|
||||
// 创建函数 - 总是静态的,返回该类型
|
||||
QW_FUNC_STATIC(compositor, create, qw_compositor *, ...)
|
||||
|
||||
// From/Get 函数 - 通常是静态的,返回该类型
|
||||
QW_FUNC_STATIC(surface, from_resource, qw_surface *, wl_resource *resource)
|
||||
|
||||
// 实例方法 - 成员函数,第一个参数匹配类型
|
||||
QW_FUNC_MEMBER(surface, has_buffer, bool)
|
||||
QW_FUNC_MEMBER(surface, send_frame_done, void, const timespec *when)
|
||||
|
||||
// 工具函数 - 检查第一个参数确定放置位置
|
||||
// 如果第一个参数是 wlr_surface* → qw_surface 的成员
|
||||
// 如果第一个参数是其他类型 → 静态函数或属于其他类
|
||||
```
|
||||
|
||||
#### 4.2 函数绑定语法
|
||||
|
||||
```cpp
|
||||
// 静态函数绑定
|
||||
QW_FUNC_STATIC(type, create, qw_type *, ...) // 创建函数,返回同类型用 qw_*
|
||||
QW_FUNC_STATIC(type, from, qw_type *, ...) // 转换函数,返回同类型用 qw_*
|
||||
QW_FUNC_STATIC(type, get, qw_type *, ...) // 获取函数,返回同类型用 qw_*
|
||||
QW_FUNC_STATIC(type, get_other, wlr_other *, ...) // 获取其他类型,保持 wlr_*
|
||||
QW_FUNC_STATIC(type, utility, return_type, ...) // 工具函数,按实际返回类型
|
||||
|
||||
// 成员函数绑定
|
||||
QW_FUNC_MEMBER(type, method, return_type, ...) // 实例方法,返回类型按实际情况
|
||||
```
|
||||
|
||||
### 5. 错误处理
|
||||
|
||||
```cpp
|
||||
// 检查对象有效性
|
||||
if (!surface->is_valid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 安全的句柄访问
|
||||
if (auto *handle = surface->handle()) {
|
||||
// 使用 handle
|
||||
}
|
||||
```
|
||||
|
||||
### 6. 版本兼容性处理
|
||||
|
||||
- 使用条件编译处理 API 变化
|
||||
- 优先支持最新版本的 API
|
||||
- 为旧版本提供兼容性宏
|
||||
|
||||
### 7. 测试
|
||||
|
||||
为新的封装类创建测试:
|
||||
|
||||
```cpp
|
||||
// tests/test_qwexample.cpp
|
||||
#include "qwexample.h"
|
||||
#include <QtTest>
|
||||
|
||||
class TestQwExample : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void testCreate();
|
||||
void testSignals();
|
||||
void testMethods();
|
||||
};
|
||||
```
|
||||
|
||||
## 常见问题和解决方案
|
||||
|
||||
### 1. 编译错误:找不到 wlroots 函数
|
||||
|
||||
**问题**:使用 `QW_FUNC_STATIC` 或 `QW_FUNC_MEMBER` 时编译失败。
|
||||
|
||||
**解决方案**:
|
||||
- 检查 wlroots 版本兼容性
|
||||
- 确认函数名拼写正确
|
||||
- 使用条件编译处理版本差异
|
||||
|
||||
### 2. 信号连接失败
|
||||
|
||||
**问题**:Qt 信号无法正常触发。
|
||||
|
||||
**解决方案**:
|
||||
- 确保使用了 `QW_OBJECT` 和 `Q_OBJECT` 宏
|
||||
- 检查信号参数类型是否正确
|
||||
- 验证 wlroots 结构体确实有对应的信号
|
||||
|
||||
### 3. 内存泄漏或崩溃
|
||||
|
||||
**问题**:对象销毁时出现问题。
|
||||
|
||||
**解决方案**:
|
||||
- 正确处理对象所有权
|
||||
- 对于有 destroy 方法的类,将析构函数设为 protected
|
||||
- 使用智能指针管理生命周期
|
||||
|
||||
## 基于 PR #322 的常见封装错误
|
||||
|
||||
基于实际代码审查经验,以下是开发者在添加新封装时容易犯的错误:
|
||||
|
||||
### 4. interface 类型的错误封装
|
||||
|
||||
**问题**:错误地尝试封装 interface 相关的 init 函数。
|
||||
|
||||
**解决方案**:
|
||||
- init 接口是给 interface 用的,不在普通类中封装
|
||||
- 应该封装对应的 interface 类型,如 `qw_allocator_interface`
|
||||
- interface 相关的封装通常需要单独处理
|
||||
|
||||
### 5. 静态函数返回类型错误
|
||||
|
||||
**问题**:静态函数返回类型与当前封装类同类型时,仍使用 `wlr_*` 类型。
|
||||
|
||||
**❌ 错误示例**:
|
||||
```cpp
|
||||
// 在 qw_color_transform 类中
|
||||
QW_FUNC_STATIC(color_transform, create, wlr_color_transform *, ...) // 错误:应该返回 qw_color_transform*
|
||||
|
||||
// 在 qw_abc 类中
|
||||
QW_FUNC_STATIC(abc, create, wlr_abc *, ...) // 错误:应该返回 qw_abc*
|
||||
QW_FUNC_STATIC(abc, get_xxx_data, wlr_xxx *, ...) // 正确:返回其他类型保持不变
|
||||
```
|
||||
|
||||
**✅ 正确格式**:
|
||||
```cpp
|
||||
// 在 qw_color_transform 类中
|
||||
QW_FUNC_STATIC(color_transform, create, qw_color_transform *, ...) // 正确:返回同类型用 qw_*
|
||||
|
||||
// 在 qw_abc 类中
|
||||
QW_FUNC_STATIC(abc, create, qw_abc *, ...) // 正确:返回同类型用 qw_*
|
||||
QW_FUNC_STATIC(abc, get_xxx_data, wlr_xxx *, ...) // 正确:返回其他类型保持 wlr_*
|
||||
```
|
||||
|
||||
**解决方案**:
|
||||
- 只有当静态函数的返回类型与当前封装的类是同类型时,才将 `wlr_*` 改为 `qw_*`
|
||||
- 如果返回的是其他类型(如 `wlr_xxx *`),则保持原始的 `wlr_*` 类型
|
||||
- 这确保了封装的一致性:同类型返回封装类型,其他类型保持原始类型
|
||||
|
||||
### 6. 冗余的 destroy 信号声明
|
||||
|
||||
**问题**:在 `QW_CLASS_OBJECT` 类中手动声明 destroy 信号。
|
||||
|
||||
**❌ 错误示例**:
|
||||
```cpp
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
QW_SIGNAL(destroy) // 冗余:基类已自动处理
|
||||
};
|
||||
```
|
||||
|
||||
**✅ 正确格式**:
|
||||
```cpp
|
||||
class QW_CLASS_OBJECT(example)
|
||||
{
|
||||
QW_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
// destroy 信号由基类自动处理,无需显式声明
|
||||
// 只声明特定的业务信号
|
||||
QW_SIGNAL(custom_event, param_type)
|
||||
};
|
||||
```
|
||||
|
||||
**解决方案**:
|
||||
- destroy 信号是 `QW_CLASS_OBJECT` 里特殊处理的,无需手动声明
|
||||
- 只声明特定的业务信号即可
|
||||
|
||||
### 7. 类型混合封装错误
|
||||
|
||||
**问题**:在一个类中混合封装不同类型的函数。
|
||||
|
||||
**❌ 错误示例**:
|
||||
```cpp
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_manager_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_manager_v1, create, ...)
|
||||
// 错误:在 manager 类中封装 syncobj_v1 类型的函数
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_v1, get_surface_state, ...)
|
||||
};
|
||||
```
|
||||
|
||||
**✅ 正确设计**:
|
||||
```cpp
|
||||
// 分离不同的类型
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_manager_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_manager_v1, create, ...)
|
||||
};
|
||||
|
||||
class QW_CLASS_REINTERPRET_CAST(linux_drm_syncobj_v1)
|
||||
{
|
||||
public:
|
||||
QW_FUNC_STATIC(linux_drm_syncobj_v1, get_surface_state, ...)
|
||||
};
|
||||
```
|
||||
|
||||
**解决方案**:
|
||||
- 在 `qw_linux_drm_syncobj_manager_v1` 里不应该封装 `linux_drm_syncobj_v1` 类型的东西
|
||||
- 每个类只封装属于自己类型的函数
|
||||
- 不同类型的函数应该分离到对应的类中
|
||||
|
||||
## 总结
|
||||
|
||||
qwlroots 的封装模式设计精巧,通过模板和宏系统提供了灵活而高效的 C++ 封装。在添加新的类封装时,应该:
|
||||
|
||||
1. 仔细分析 wlroots 结构体的特性
|
||||
2. 选择合适的封装模式
|
||||
3. 遵循项目的命名和代码规范
|
||||
4. 处理版本兼容性问题
|
||||
5. 编写相应的测试代码
|
||||
|
||||
通过遵循这些最佳实践,可以确保新添加的封装类与项目整体架构保持一致,并提供良好的开发体验。
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
include_directories(PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
add_subdirectory(tinywl)
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.21..3.27)
|
||||
project(tinywl)
|
||||
|
||||
set(TARGET tinywl)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL) # if build as a separated project
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
find_package(QWlroots REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED)
|
||||
|
||||
set(SOURCES main.cpp)
|
||||
|
||||
add_executable(${TARGET}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET}
|
||||
PRIVATE
|
||||
QWlroots::QWlroots
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
)
|
||||
|
|
@ -0,0 +1,685 @@
|
|||
// Copyright (C) 2022 JiDe Zhang <zccrs@live.com>.
|
||||
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QProcess>
|
||||
#include <QRect>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include <qwbackend.h>
|
||||
#include <qwdisplay.h>
|
||||
#include <qwrenderer.h>
|
||||
#include <qwallocator.h>
|
||||
#include <qwcompositor.h>
|
||||
#include <qwsubcompositor.h>
|
||||
#include <qwdatadevice.h>
|
||||
#include <qwoutputlayout.h>
|
||||
#include <qwoutput.h>
|
||||
#include <qwscene.h>
|
||||
#include <qwseat.h>
|
||||
#include <qwxdgshell.h>
|
||||
#include <qwcursor.h>
|
||||
#include <qwxcursormanager.h>
|
||||
#include <qwinputdevice.h>
|
||||
#include <qwkeyboard.h>
|
||||
#include <qwpointer.h>
|
||||
#include <qwtexture.h>
|
||||
#include <qwlogging.h>
|
||||
#include <qwbox.h>
|
||||
|
||||
class Q_DECL_HIDDEN TinywlServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TinywlServer();
|
||||
~TinywlServer();
|
||||
|
||||
bool start();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onNewOutput(wlr_output *output);
|
||||
#if WLR_VERSION_MINOR < 18
|
||||
void onNewXdgSurface(wlr_xdg_surface *surface);
|
||||
#endif
|
||||
void onNewXdgToplevel(wlr_xdg_toplevel *surface);
|
||||
void onNewXdgPopup(wlr_xdg_popup *surface);
|
||||
|
||||
void onMap();
|
||||
void onUnmap();
|
||||
void onXdgToplevelRequestMove(wlr_xdg_toplevel_move_event *);
|
||||
void onXdgToplevelRequestResize(wlr_xdg_toplevel_resize_event *event);
|
||||
void onXdgToplevelRequestMaximize();
|
||||
void onXdgToplevelRequestRequestFullscreen();
|
||||
|
||||
void onCursorMotion(wlr_pointer_motion_event *event);
|
||||
void onCursorMotionAbsolute(wlr_pointer_motion_absolute_event *event);
|
||||
void onCursorButton(wlr_pointer_button_event *event);
|
||||
void onCursorAxis(wlr_pointer_axis_event *event);
|
||||
void onCursorFrame();
|
||||
|
||||
void onNewInput(wlr_input_device *device);
|
||||
void onRequestSetCursor(wlr_seat_pointer_request_set_cursor_event *event);
|
||||
void onRequestSetSelection(wlr_seat_request_set_selection_event *event);
|
||||
|
||||
void onKeyboardModifiers();
|
||||
void onKeyboardKey(wlr_keyboard_key_event *event);
|
||||
void onKeyboardDestroy();
|
||||
|
||||
void onOutputFrame();
|
||||
|
||||
private:
|
||||
struct View
|
||||
{
|
||||
TinywlServer *server;
|
||||
qw_xdg_toplevel *xdgToplevel;
|
||||
qw_scene_tree *sceneTree;
|
||||
QPointF pos;
|
||||
};
|
||||
|
||||
enum class CursorState {
|
||||
Normal,
|
||||
MovingWindow,
|
||||
ResizingWindow,
|
||||
};
|
||||
|
||||
static inline View *getView(const qw_xdg_surface *surface);
|
||||
View *viewAt(const QPointF &pos, wlr_surface **surface, QPointF *spos) const;
|
||||
void processCursorMotion(uint32_t time);
|
||||
void focusView(View *view, wlr_surface *surface);
|
||||
void beginInteractive(View *view, CursorState state, uint32_t edges);
|
||||
bool handleKeybinding(xkb_keysym_t sym);
|
||||
|
||||
qw_display *display;
|
||||
qw_backend *backend;
|
||||
qw_renderer *renderer;
|
||||
qw_allocator *allocator;
|
||||
|
||||
qw_compositor *compositor;
|
||||
qw_subcompositor *subcompositor;
|
||||
qw_data_device_manager *dataDeviceManager;
|
||||
|
||||
qw_output_layout *outputLayout;
|
||||
QList<qw_output*> outputs;
|
||||
|
||||
qw_scene *scene;
|
||||
qw_scene_output_layout *scene_layout;
|
||||
|
||||
qw_xdg_shell *xdgShell;
|
||||
QList<View*> views;
|
||||
View *grabbedView = nullptr;
|
||||
QPointF grabCursorPos;
|
||||
QRectF grabGeoBox;
|
||||
|
||||
qw_cursor *cursor;
|
||||
qw_xcursor_manager *cursorManager;
|
||||
CursorState cursorState = CursorState::Normal;
|
||||
uint32_t resizingEdges = 0;
|
||||
|
||||
QList<qw_keyboard*> keyboards;
|
||||
qw_seat *seat;
|
||||
};
|
||||
|
||||
TinywlServer::TinywlServer()
|
||||
{
|
||||
display = new qw_display();
|
||||
#if WLR_VERSION_MINOR > 17
|
||||
backend = qw_backend::autocreate(display->get_event_loop(), nullptr);
|
||||
#else
|
||||
backend = qw_backend::autocreate(*display, nullptr);
|
||||
#endif
|
||||
if (!backend)
|
||||
qFatal("failed to create wlr_backend");
|
||||
|
||||
// Add output
|
||||
// auto multiBackend = qobject_cast<qw_multi_backend*>(backend);
|
||||
// multiBackend->for_each_backend([] (struct wlr_backend *backend, void *data) {
|
||||
// auto x11 = qw_x11_backend::from(backend);
|
||||
// if (x11)
|
||||
// x11->output_create();
|
||||
// }, nullptr);
|
||||
|
||||
renderer = qw_renderer::autocreate(*backend);
|
||||
if (!renderer)
|
||||
qFatal("failed to create wlr_renderer");
|
||||
renderer->init_wl_display(*display);
|
||||
|
||||
allocator = qw_allocator::autocreate(*backend, *renderer);
|
||||
if (!allocator)
|
||||
qFatal("failed to create wlr_allocator");
|
||||
|
||||
compositor = qw_compositor::create(*display, 4, *renderer);
|
||||
subcompositor = qw_subcompositor::create(*display);
|
||||
dataDeviceManager = qw_data_device_manager::create(*display);
|
||||
|
||||
#if WLR_VERSION_MAJOR == 0 && WLR_VERSION_MINOR < 18
|
||||
outputLayout = new qw_output_layout(display);
|
||||
#else
|
||||
outputLayout = new qw_output_layout(*display);
|
||||
#endif
|
||||
connect(backend, &qw_backend::notify_new_output, this, &TinywlServer::onNewOutput);
|
||||
|
||||
scene = qw_scene::create();
|
||||
scene_layout = qw_scene_output_layout::from(scene->attach_output_layout(*outputLayout));
|
||||
xdgShell = qw_xdg_shell::create(*display, 3);
|
||||
#if WLR_VERSION_MINOR > 17
|
||||
connect(xdgShell, &qw_xdg_shell::notify_new_toplevel, this, &TinywlServer::onNewXdgToplevel);
|
||||
connect(xdgShell, &qw_xdg_shell::notify_new_popup, this, &TinywlServer::onNewXdgPopup);
|
||||
#else
|
||||
connect(xdgShell, &qw_xdg_shell::notify_new_surface, this, &TinywlServer::onNewXdgSurface);
|
||||
#endif
|
||||
|
||||
cursor = qw_cursor::create();
|
||||
cursor->attach_output_layout(*outputLayout);
|
||||
cursorManager = qw_xcursor_manager::create(nullptr, 24);
|
||||
cursorManager->load(1);
|
||||
connect(cursor, &qw_cursor::notify_motion, this, &TinywlServer::onCursorMotion);
|
||||
connect(cursor, &qw_cursor::notify_motion_absolute, this, &TinywlServer::onCursorMotionAbsolute);
|
||||
connect(cursor, &qw_cursor::notify_button, this, &TinywlServer::onCursorButton);
|
||||
connect(cursor, &qw_cursor::notify_axis, this, &TinywlServer::onCursorAxis);
|
||||
connect(cursor, &qw_cursor::notify_frame, this, &TinywlServer::onCursorFrame);
|
||||
|
||||
connect(backend, &qw_backend::notify_new_input, this, &TinywlServer::onNewInput);
|
||||
|
||||
seat = qw_seat::create(*display, "seat0");
|
||||
connect(seat, &qw_seat::notify_request_set_cursor, this, &TinywlServer::onRequestSetCursor);
|
||||
connect(seat, &qw_seat::notify_request_set_selection, this, &TinywlServer::onRequestSetSelection);
|
||||
}
|
||||
|
||||
TinywlServer::~TinywlServer()
|
||||
{
|
||||
delete backend;
|
||||
}
|
||||
|
||||
bool TinywlServer::start()
|
||||
{
|
||||
const char *socket = display->add_socket_auto();
|
||||
if (!socket) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!backend->start())
|
||||
return false;
|
||||
|
||||
qputenv("WAYLAND_DISPLAY", QByteArray(socket));
|
||||
qInfo("Running Wayland compositor on WAYLAND_DISPLAY=%s", socket);
|
||||
|
||||
display->start(qApp->thread());
|
||||
return true;
|
||||
}
|
||||
|
||||
void TinywlServer::onNewOutput(wlr_output *wl_output)
|
||||
{
|
||||
auto output = qw_output::from(wl_output);
|
||||
Q_ASSERT(output);
|
||||
outputs.append(output);
|
||||
output->init_render(*allocator, *renderer);
|
||||
|
||||
wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
if (!wl_list_empty(&output->handle()->modes)) {
|
||||
auto *mode = output->preferred_mode();
|
||||
wlr_output_state_set_mode(&state, mode);
|
||||
}
|
||||
wlr_output_state_set_enabled(&state, true);
|
||||
if (!output->commit_state(&state))
|
||||
return;
|
||||
|
||||
connect(output, &qw_output::notify_frame, this, &TinywlServer::onOutputFrame);
|
||||
auto l_output =outputLayout->add_auto(*output);
|
||||
auto sceneOutput = qw_scene_output::create(*scene, *output);
|
||||
scene_layout->add_output(l_output, *sceneOutput);
|
||||
}
|
||||
|
||||
#if WLR_VERSION_MINOR < 18
|
||||
void TinywlServer::onNewXdgSurface(wlr_xdg_surface *surface)
|
||||
{
|
||||
if (surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
||||
onNewXdgPopup(surface->popup);
|
||||
} else {
|
||||
Q_ASSERT(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
|
||||
onNewXdgToplevel(surface->toplevel);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if QT_VERSION_MAJOR < 6
|
||||
Q_DECLARE_METATYPE(QMetaObject::Connection)
|
||||
#endif
|
||||
|
||||
void TinywlServer::onNewXdgPopup(wlr_xdg_popup *popup)
|
||||
{
|
||||
auto parent = qw_xdg_surface::try_from_wlr_surface(popup->parent);
|
||||
qw_scene_tree *parentTree = reinterpret_cast<qw_scene_tree*>(parent->handle()->data);
|
||||
popup->base->data = qw_scene::xdg_surface_create(*parentTree, popup->base);
|
||||
#if WLR_VERSION_MINOR >= 18
|
||||
auto qwPopup = qw_xdg_popup::from(popup);
|
||||
QMetaObject::Connection initialCommitConn = connect(qw_surface::from(popup->base->surface), &qw_surface::notify_commit,
|
||||
qwPopup, [qwPopup] {
|
||||
if (qwPopup->handle()->base->initial_commit) {
|
||||
qw_xdg_surface::from(qwPopup->handle()->base)->schedule_configure();
|
||||
QObject::disconnect(qvariant_cast<QMetaObject::Connection>(qwPopup->property("__initialCommitConn")));
|
||||
qwPopup->setProperty("__initialCommitConn", QVariant());
|
||||
}
|
||||
});
|
||||
qwPopup->setProperty("__initialCommitConn", QVariant::fromValue(initialCommitConn));
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void TinywlServer::onNewXdgToplevel(wlr_xdg_toplevel *toplevel)
|
||||
{
|
||||
auto view = new View();
|
||||
view->server = this;
|
||||
auto s = qw_xdg_toplevel::from(toplevel);
|
||||
view->xdgToplevel = s;
|
||||
view->sceneTree = qw_scene::xdg_surface_create(&(*scene)->tree, toplevel->base);
|
||||
view->sceneTree->handle()->node.data = view;
|
||||
toplevel->base->data = view->sceneTree;
|
||||
auto *ss = qw_surface::from(toplevel->base->surface);
|
||||
connect(ss, &qw_surface::notify_map, this, &TinywlServer::onMap);
|
||||
connect(ss, &qw_surface::notify_unmap, this, &TinywlServer::onUnmap);
|
||||
connect(s, &qw_xdg_toplevel::notify_request_move, this, &TinywlServer::onXdgToplevelRequestMove);
|
||||
connect(s, &qw_xdg_toplevel::notify_request_resize, this, &TinywlServer::onXdgToplevelRequestResize);
|
||||
connect(s, &qw_xdg_toplevel::notify_request_maximize, this, &TinywlServer::onXdgToplevelRequestMaximize);
|
||||
connect(s, &qw_xdg_toplevel::notify_request_fullscreen, this, &TinywlServer::onXdgToplevelRequestRequestFullscreen);
|
||||
connect(s, &qw_xdg_toplevel::before_destroy, this, [this, view] {
|
||||
views.removeOne(view);
|
||||
if (grabbedView == view)
|
||||
grabbedView = nullptr;
|
||||
delete view;
|
||||
});
|
||||
#if WLR_VERSION_MINOR >= 18
|
||||
QMetaObject::Connection initialCommitConn = connect(qw_surface::from(toplevel->base->surface), &qw_surface::notify_commit,
|
||||
s, [s] {
|
||||
if (s->handle()->base->initial_commit) {
|
||||
s->set_size(0, 0);
|
||||
QObject::disconnect(qvariant_cast<QMetaObject::Connection>(s->property("__initialCommitConn")));
|
||||
s->setProperty("__initialCommitConn", QVariant());
|
||||
}
|
||||
});
|
||||
s->setProperty("__initialCommitConn", QVariant::fromValue(initialCommitConn));
|
||||
#endif
|
||||
}
|
||||
|
||||
void TinywlServer::onMap()
|
||||
{
|
||||
auto surface = qw_xdg_surface::try_from_wlr_surface(*qobject_cast<qw_surface*>(sender()));
|
||||
if (!surface)
|
||||
return;
|
||||
auto view = getView(surface);
|
||||
Q_ASSERT(view);
|
||||
views.append(view);
|
||||
focusView(view, (*surface)->surface);
|
||||
}
|
||||
|
||||
void TinywlServer::onUnmap()
|
||||
{
|
||||
auto surface = qw_xdg_surface::try_from_wlr_surface(*qobject_cast<qw_surface*>(sender()));
|
||||
if (!surface)
|
||||
return;
|
||||
auto view = getView(surface);
|
||||
Q_ASSERT(view);
|
||||
views.removeOne(view);
|
||||
}
|
||||
|
||||
void TinywlServer::onXdgToplevelRequestMove(wlr_xdg_toplevel_move_event *)
|
||||
{
|
||||
auto surface = qobject_cast<qw_xdg_toplevel*>(sender());
|
||||
auto view = getView(qw_xdg_surface::from((*surface)->base));
|
||||
Q_ASSERT(view);
|
||||
beginInteractive(view, CursorState::MovingWindow, 0);
|
||||
}
|
||||
|
||||
void TinywlServer::onXdgToplevelRequestResize(wlr_xdg_toplevel_resize_event *event)
|
||||
{
|
||||
auto surface = qobject_cast<qw_xdg_toplevel*>(sender());
|
||||
auto view = getView(qw_xdg_surface::from((*surface)->base));
|
||||
Q_ASSERT(view);
|
||||
beginInteractive(view, CursorState::ResizingWindow, event->edges);
|
||||
}
|
||||
|
||||
void TinywlServer::onXdgToplevelRequestMaximize()
|
||||
{
|
||||
auto surface = qobject_cast<qw_xdg_toplevel*>(sender());
|
||||
qw_xdg_surface::from((*surface)->base)->schedule_configure();
|
||||
}
|
||||
|
||||
void TinywlServer::onXdgToplevelRequestRequestFullscreen()
|
||||
{
|
||||
auto surface = qobject_cast<qw_xdg_toplevel*>(sender());
|
||||
qw_xdg_surface::from((*surface)->base)->schedule_configure();
|
||||
}
|
||||
|
||||
void TinywlServer::onCursorMotion(wlr_pointer_motion_event *event)
|
||||
{
|
||||
cursor->move(&event->pointer->base, event->delta_x, event->delta_y);
|
||||
processCursorMotion(event->time_msec);
|
||||
}
|
||||
|
||||
void TinywlServer::onCursorMotionAbsolute(wlr_pointer_motion_absolute_event *event)
|
||||
{
|
||||
cursor->warp_absolute(&event->pointer->base, event->x, event->y);
|
||||
processCursorMotion(event->time_msec);
|
||||
}
|
||||
|
||||
void TinywlServer::onCursorButton(wlr_pointer_button_event *event)
|
||||
{
|
||||
seat->pointer_notify_button(event->time_msec, event->button, event->state);
|
||||
QPointF spos;
|
||||
wlr_surface *surface = nullptr;
|
||||
auto view = viewAt(QPointF((*cursor)->x, (*cursor)->y), &surface, &spos);
|
||||
#if WLR_VERSION_MINOR > 17
|
||||
if (event->state == WL_POINTER_BUTTON_STATE_RELEASED) {
|
||||
#else
|
||||
if (event->state == WLR_BUTTON_RELEASED) {
|
||||
#endif
|
||||
cursorState = CursorState::Normal;
|
||||
} else {
|
||||
focusView(view, surface);
|
||||
}
|
||||
}
|
||||
|
||||
void TinywlServer::onCursorAxis(wlr_pointer_axis_event *event)
|
||||
{
|
||||
seat->pointer_notify_axis(event->time_msec, event->orientation,
|
||||
event->delta, event->delta_discrete, event->source
|
||||
#if WLR_VERSION_MINOR > 17
|
||||
, event->relative_direction
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
void TinywlServer::onCursorFrame()
|
||||
{
|
||||
seat->pointer_notify_frame();
|
||||
}
|
||||
|
||||
void TinywlServer::onNewInput(wlr_input_device *wl_device)
|
||||
{
|
||||
auto device = qw_input_device::from(wl_device);
|
||||
if (qw_keyboard *keyboard = qobject_cast<qw_keyboard*>(device)) {
|
||||
|
||||
xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
xkb_keymap *keymap = xkb_keymap_new_from_names(context, nullptr, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
|
||||
keyboard->set_keymap(keymap);
|
||||
xkb_keymap_unref(keymap);
|
||||
xkb_context_unref(context);
|
||||
keyboard->set_repeat_info(25, 600);
|
||||
|
||||
connect(keyboard, &qw_keyboard::notify_modifiers, this, &TinywlServer::onKeyboardModifiers);
|
||||
connect(keyboard, &qw_keyboard::notify_key, this, &TinywlServer::onKeyboardKey);
|
||||
connect(keyboard, &qw_keyboard::before_destroy, this, &TinywlServer::onKeyboardDestroy);
|
||||
|
||||
seat->set_keyboard(*keyboard);
|
||||
|
||||
Q_ASSERT(!keyboards.contains(keyboard));
|
||||
keyboards.append(keyboard);
|
||||
} else if (device->handle()->type == WLR_INPUT_DEVICE_POINTER) {
|
||||
cursor->attach_input_device(*device);
|
||||
}
|
||||
|
||||
uint32_t caps = WL_SEAT_CAPABILITY_POINTER;
|
||||
if (!keyboards.isEmpty()) {
|
||||
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
|
||||
}
|
||||
seat->set_capabilities(caps);
|
||||
}
|
||||
|
||||
void TinywlServer::onRequestSetCursor(wlr_seat_pointer_request_set_cursor_event *event)
|
||||
{
|
||||
if (seat->handle()->pointer_state.focused_client == event->seat_client)
|
||||
cursor->set_surface(event->surface, event->hotspot_x, event->hotspot_y);
|
||||
}
|
||||
|
||||
void TinywlServer::onRequestSetSelection(wlr_seat_request_set_selection_event *event)
|
||||
{
|
||||
seat->set_selection(event->source, event->serial);
|
||||
}
|
||||
|
||||
void TinywlServer::onKeyboardModifiers()
|
||||
{
|
||||
qw_keyboard *keyboard = qobject_cast<qw_keyboard*>(QObject::sender());
|
||||
seat->set_keyboard(*keyboard);
|
||||
seat->keyboard_notify_modifiers(&keyboard->handle()->modifiers); // (*keyboard)->modifiers
|
||||
}
|
||||
|
||||
void TinywlServer::onKeyboardKey(wlr_keyboard_key_event *event)
|
||||
{
|
||||
qw_keyboard *keyboard = qobject_cast<qw_keyboard*>(QObject::sender());
|
||||
// Translate libinput keycode -> xkbcommon
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
const xkb_keysym_t *syms;
|
||||
int nsyms = xkb_state_key_get_syms(keyboard->handle()->xkb_state, keycode, &syms);
|
||||
|
||||
bool handled = false;
|
||||
uint32_t modifiers = keyboard->get_modifiers();
|
||||
if ((modifiers & (WLR_MODIFIER_ALT | WLR_MODIFIER_CTRL))
|
||||
&& event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||
for (int i = 0; i < nsyms; i++)
|
||||
handled = handleKeybinding(syms[i]);
|
||||
}
|
||||
|
||||
if (!handled) {
|
||||
seat->set_keyboard(*keyboard);
|
||||
seat->keyboard_notify_key(event->time_msec, event->keycode, event->state);
|
||||
}
|
||||
}
|
||||
|
||||
void TinywlServer::onKeyboardDestroy()
|
||||
{
|
||||
qw_keyboard *keyboard = qobject_cast<qw_keyboard*>(QObject::sender());
|
||||
keyboards.removeOne(keyboard);
|
||||
}
|
||||
|
||||
void TinywlServer::onOutputFrame()
|
||||
{
|
||||
auto output = qobject_cast<qw_output*>(sender());
|
||||
Q_ASSERT(output);
|
||||
|
||||
auto sceneOutput = qw_scene_output::from(scene->get_scene_output(*output));
|
||||
sceneOutput->commit(nullptr);
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
sceneOutput->send_frame_done(&now);
|
||||
}
|
||||
|
||||
TinywlServer::View *TinywlServer::getView(const qw_xdg_surface *surface)
|
||||
{
|
||||
auto sceneTree = reinterpret_cast<qw_scene_tree*>(surface->handle()->data);
|
||||
return reinterpret_cast<View*>(sceneTree->handle()->node.data);
|
||||
}
|
||||
|
||||
TinywlServer::View *TinywlServer::viewAt(const QPointF &pos, wlr_surface **surface, QPointF *spos) const
|
||||
{
|
||||
double spos_x, spos_y;
|
||||
auto node = scene->at(pos.x(), pos.y(), &spos_x, &spos_y);
|
||||
spos->setX(spos_x);
|
||||
spos->setY(spos_y);
|
||||
if (!node || node->type != WLR_SCENE_NODE_BUFFER) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto *sceneBuffer = qw_scene_buffer::from(node);
|
||||
auto *sceneSurface = wlr_scene_surface_try_from_buffer(sceneBuffer->handle());
|
||||
if (!sceneSurface)
|
||||
return nullptr;
|
||||
|
||||
*surface = sceneSurface->surface;
|
||||
wlr_scene_tree *tree = node->parent;
|
||||
while (tree && !tree->node.data) {
|
||||
tree = tree->node.parent;
|
||||
}
|
||||
|
||||
return tree ? reinterpret_cast<View*>(tree->node.data) : nullptr;
|
||||
}
|
||||
|
||||
void TinywlServer::processCursorMotion(uint32_t time)
|
||||
{
|
||||
if (cursorState == CursorState::MovingWindow) {
|
||||
grabbedView->pos = grabGeoBox.topLeft() + (QPointF((*cursor)->x, (*cursor)->y) - grabCursorPos);
|
||||
grabbedView->sceneTree->set_position(grabbedView->pos.x(), grabbedView->pos.y());
|
||||
return;
|
||||
} else if (cursorState == CursorState::ResizingWindow) {
|
||||
const QPointF cursorPos((*cursor)->x, (*cursor)->y);
|
||||
QRectF newGeoBox = grabGeoBox;
|
||||
const int minimumSize = 10;
|
||||
|
||||
if (resizingEdges & WLR_EDGE_TOP) {
|
||||
newGeoBox.setTop(cursorPos.y());
|
||||
} else if (resizingEdges & WLR_EDGE_BOTTOM) {
|
||||
newGeoBox.setBottom(cursorPos.y());
|
||||
}
|
||||
if (resizingEdges & WLR_EDGE_LEFT) {
|
||||
newGeoBox.setLeft(cursorPos.x());
|
||||
} else if (resizingEdges & WLR_EDGE_RIGHT) {
|
||||
newGeoBox.setRight(cursorPos.x());
|
||||
}
|
||||
|
||||
QSize minSize(grabbedView->xdgToplevel->handle()->current.min_width,
|
||||
grabbedView->xdgToplevel->handle()->current.min_height);
|
||||
QSize maxSize(grabbedView->xdgToplevel->handle()->current.max_width,
|
||||
grabbedView->xdgToplevel->handle()->current.max_height);
|
||||
|
||||
if (maxSize.width() == 0)
|
||||
maxSize.setWidth(99999);
|
||||
if (maxSize.height() == 0)
|
||||
maxSize.setHeight(99999);
|
||||
|
||||
qw_box current_geo_box;
|
||||
#if WLR_VERSION_MINOR < 19
|
||||
qw_xdg_surface::from(grabbedView->xdgToplevel->handle()->base)->get_geometry(current_geo_box);
|
||||
#else
|
||||
current_geo_box = qw_box(qw_xdg_surface::from(grabbedView->xdgToplevel->handle()->base)->handle()->geometry);
|
||||
#endif
|
||||
auto currentGeoBox = current_geo_box.toQRect();
|
||||
|
||||
currentGeoBox.moveTopLeft((grabbedView->pos + currentGeoBox.topLeft()).toPoint());
|
||||
if (newGeoBox.width() < qMax(minimumSize, minSize.width()) || newGeoBox.width() > maxSize.width()) {
|
||||
newGeoBox.setLeft(currentGeoBox.left());
|
||||
newGeoBox.setRight(currentGeoBox.right());
|
||||
}
|
||||
|
||||
if (newGeoBox.height() < qMax(minimumSize, minSize.height()) || newGeoBox.height() > maxSize.height()) {
|
||||
newGeoBox.setTop(currentGeoBox.top());
|
||||
newGeoBox.setBottom(currentGeoBox.bottom());
|
||||
}
|
||||
|
||||
grabbedView->pos = newGeoBox.topLeft();
|
||||
const QPoint &treePosition = grabbedView->pos.toPoint();
|
||||
grabbedView->sceneTree->set_position(treePosition.x(), treePosition.y());
|
||||
const QSize &toplevelSize = newGeoBox.size().toSize();
|
||||
grabbedView->xdgToplevel->set_size(toplevelSize.width(), toplevelSize.height());
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_surface *surface = nullptr;
|
||||
QPointF spos;
|
||||
auto view = viewAt(QPointF((*cursor)->x, (*cursor)->y), &surface, &spos);
|
||||
if (!view)
|
||||
cursor->set_xcursor(*cursorManager, "left_ptr");
|
||||
if (surface) {
|
||||
seat->pointer_notify_enter(surface, spos.x(), spos.y());
|
||||
seat->pointer_notify_motion(time, spos.x(), spos.y());
|
||||
} else {
|
||||
seat->pointer_clear_focus();
|
||||
}
|
||||
}
|
||||
|
||||
void TinywlServer::focusView(View *view, wlr_surface *surface)
|
||||
{
|
||||
if (!view)
|
||||
return;
|
||||
|
||||
wlr_surface *prevSurface = seat->handle()->keyboard_state.focused_surface;
|
||||
if (prevSurface == surface) {
|
||||
return;
|
||||
}
|
||||
if (prevSurface) {
|
||||
auto toplevel = qw_xdg_toplevel::try_from_wlr_surface(prevSurface);
|
||||
Q_ASSERT(toplevel);
|
||||
toplevel->set_activated(false);
|
||||
}
|
||||
|
||||
view->sceneTree->raise_to_top();
|
||||
views.move(views.indexOf(view), 0);
|
||||
view->xdgToplevel->set_activated(true);
|
||||
|
||||
if (wlr_keyboard *keyboard = seat->get_keyboard()) {
|
||||
seat->keyboard_notify_enter(view->xdgToplevel->handle()->base->surface,
|
||||
keyboard->keycodes, keyboard->num_keycodes, &keyboard->modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
void TinywlServer::beginInteractive(View *view, CursorState state, uint32_t edges)
|
||||
{
|
||||
wlr_surface *focusedSurface = (*seat)->pointer_state.focused_surface;
|
||||
if (view->xdgToplevel->handle()->base->surface !=
|
||||
wlr_surface_get_root_surface(focusedSurface)) {
|
||||
return;
|
||||
}
|
||||
grabbedView = view;
|
||||
cursorState = state;
|
||||
grabCursorPos = QPointF((*cursor)->x, (*cursor)->y);
|
||||
wlr_box grab_geo_box;
|
||||
#if WLR_VERSION_MINOR < 19
|
||||
qw_xdg_surface::from(view->xdgToplevel->handle()->base)->get_geometry(&grab_geo_box);
|
||||
#else
|
||||
grab_geo_box = qw_xdg_surface::from(view->xdgToplevel->handle()->base)->handle()->geometry;
|
||||
#endif
|
||||
|
||||
grabGeoBox.moveTopLeft(view->pos + QPoint(grab_geo_box.x, grab_geo_box.y));
|
||||
grabGeoBox.setWidth(grab_geo_box.width);
|
||||
grabGeoBox.setHeight(grab_geo_box.height);
|
||||
resizingEdges = edges;
|
||||
}
|
||||
|
||||
bool TinywlServer::handleKeybinding(xkb_keysym_t sym)
|
||||
{
|
||||
switch (sym) {
|
||||
case XKB_KEY_Escape:
|
||||
display->terminate();
|
||||
qApp->exit();
|
||||
break;
|
||||
case XKB_KEY_F1:
|
||||
if (views.size() < 2)
|
||||
break;
|
||||
|
||||
focusView(views.at(1), views.at(1)->xdgToplevel->handle()->base->surface);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
qw_log::init();
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
app.setApplicationName("tinywl");
|
||||
app.setApplicationVersion("0.0.1");
|
||||
|
||||
QCommandLineOption startup("s", "startup command", "command");
|
||||
QCommandLineParser cl;
|
||||
|
||||
cl.addOption(startup);
|
||||
cl.addHelpOption();
|
||||
cl.addVersionOption();
|
||||
cl.process(app);
|
||||
|
||||
TinywlServer server;
|
||||
if (!server.start())
|
||||
return -1;
|
||||
|
||||
if (cl.isSet(startup)) {
|
||||
const QString command = cl.value(startup);
|
||||
QProcess::startDetached("/bin/sh", {"-c", command});
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
#include "main.moc"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue