pax_global_header00006660000000000000000000000064147622666220014527gustar00rootroot0000000000000052 comment=b7e1991ca948389fcdfa4e91d8952e7e04336b7f qt5platform-plugins-5.7.12/000077500000000000000000000000001476226662200155605ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.clog.toml000066400000000000000000000002261476226662200174570ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5dxcb-plugin" from-latest-tag = true changelog = "CHANGELOG.md" [sections] Others = ["chore"] qt5platform-plugins-5.7.12/.github/000077500000000000000000000000001476226662200171205ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.github/ISSUE_TEMPLATE/000077500000000000000000000000001476226662200213035ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000023651476226662200233010ustar00rootroot00000000000000blank_issues_enabled: false contact_links: - name: BUG Report | 缺陷报告 url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=bug-report.yml about: Please create bug reports to the issue board in our dtk repo. - name: docs-update | 文档补充 url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=docs-update.yml about: Please create docs-update to the issue board in our dtk repo. - name: unit-test-report | 单元测试报告 url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=unit-test-report.yml about: Please create unit-test-report to the issue board in our dtk repo. - name: Feature Request | 特性请求 url: https://github.com/linuxdeepin/developer-center/discussions/new?category=features-request-ideas-%E7%89%B9%E6%80%A7%E8%AF%B7%E6%B1%82-%E5%A4%B4%E8%84%91%E9%A3%8E%E6%9A%B4 about: Please create feature requests to the discussion board in our developer-center repo. - name: General Discussion & Questions | 常规讨论与问答 url: https://github.com/linuxdeepin/developer-center/discussions/categories/q-a-%E9%97%AE%E7%AD%94%E6%9D%BF%E5%9D%97 about: Please use the discussion board in our developer-center repo. qt5platform-plugins-5.7.12/.github/ISSUE_TEMPLATE/empty-issue.md000066400000000000000000000001301476226662200241030ustar00rootroot00000000000000--- name: Empty issue about: File a Empty issue title: '' labels: '' assignees: '' --- qt5platform-plugins-5.7.12/.github/workflows/000077500000000000000000000000001476226662200211555ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.github/workflows/backup-to-gitlab.yml000066400000000000000000000005371476226662200250320ustar00rootroot00000000000000name: backup to gitlab on: [push] concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: backup-to-gitlabwh: uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master secrets: inherit backup-to-gitee: uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master secrets: inherit qt5platform-plugins-5.7.12/.github/workflows/call-auto-tag.yml000066400000000000000000000005171476226662200243350ustar00rootroot00000000000000name: auto tag on: pull_request_target: types: [opened, synchronize, closed] paths: - "debian/changelog" concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: auto_tag: uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master secrets: inherit qt5platform-plugins-5.7.12/.github/workflows/call-build-distribution.yml000066400000000000000000000004321476226662200264240ustar00rootroot00000000000000name: Call build-distribution on: push: paths-ignore: - ".github/workflows/**" pull_request_target: paths-ignore: - ".github/workflows/**" jobs: check_job: uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master secrets: inherit qt5platform-plugins-5.7.12/.github/workflows/call-chatOps.yml000066400000000000000000000002421476226662200242100ustar00rootroot00000000000000name: chatOps on: issue_comment: types: [created] jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master secrets: inherit qt5platform-plugins-5.7.12/.github/workflows/call-clacheck.yml000066400000000000000000000005251476226662200243500ustar00rootroot00000000000000name: Call CLA check on: issue_comment: types: [created] pull_request_target: types: [opened, closed, synchronize] concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: clacheck: uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master secrets: inherit qt5platform-plugins-5.7.12/.github/workflows/call-commitlint.yml000066400000000000000000000003641476226662200247730ustar00rootroot00000000000000name: Call commitlint on: pull_request_target: concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: check_job: uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master qt5platform-plugins-5.7.12/.github/workflows/call-license-check.yml000066400000000000000000000005521476226662200253100ustar00rootroot00000000000000name: Call License and README Check on: pull_request_target: types: [opened, synchronize, reopened] permissions: pull-requests: write contents: read concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: license-check: uses: linuxdeepin/.github/.github/workflows/license-check.yml@master qt5platform-plugins-5.7.12/.github/workflows/call-synchronize-to-dtk6.yml000066400000000000000000000010441476226662200264510ustar00rootroot00000000000000name: Call synchronize to dtk6 on: pull_request_target: paths-ignore: - "debian/**" - "archlinux/**" - "rpm/**" - ".obs/**" - ".github/**" jobs: call-synchronize: uses: linuxdeepin/dtk/.github/workflows/synchronize-to-dtk6.yml@master secrets: inherit with: dest_repo: linuxdeepin/qt6platform-plugins source_repo: ${{ github.event.pull_request.head.repo.full_name }} source_ref: ${{ github.event.pull_request.head.ref }} pull_number: ${{ github.event.pull_request.number }} qt5platform-plugins-5.7.12/.github/workflows/cppcheck.yml000066400000000000000000000012651476226662200234640ustar00rootroot00000000000000name: cppcheck on: pull_request_target: paths-ignore: - ".github/workflows/**" concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: cppchceck: name: cppcheck runs-on: ubuntu-latest steps: - run: export - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - uses: linuxdeepin/action-cppcheck@main with: github_token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} pull_request_id: ${{ github.event.pull_request.number }} allow_approve: false qt5platform-plugins-5.7.12/.gitignore000066400000000000000000000005461476226662200175550ustar00rootroot00000000000000*.pro.user* build*/ bin/ # C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.dll *.dylib # Qt-es /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp qrc_*.cpp ui_*.h Makefile* *build-* # QtCreator *.autosave # QtCtreator Qml *.qmlproject.user *.qmlproject.user.* # QtCtreator CMake CMakeLists.txt.user qt5platform-plugins-5.7.12/.gitlab-ci.yml000066400000000000000000000002271476226662200202150ustar00rootroot00000000000000include: - remote: 'https://gitlab.deepin.io/dev-tools/letmeci/raw/master/gitlab-ci/dde.yml' variables: CPPCHECK: "true" CODESPELL: "true" qt5platform-plugins-5.7.12/.obs/000077500000000000000000000000001476226662200164215ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.obs/workflows.yml000066400000000000000000000022231476226662200212000ustar00rootroot00000000000000test_build: steps: - link_package: source_project: deepin:Develop:dde source_package: %{SCM_REPOSITORY_NAME} target_project: deepin:CI - configure_repositories: project: deepin:CI repositories: - name: deepin_develop paths: - target_project: deepin:CI target_repository: deepin_develop architectures: - x86_64 - aarch64 - name: debian paths: - target_project: deepin:CI target_repository: debian_sid architectures: - x86_64 - name: archlinux paths: - target_project: deepin:CI target_repository: archlinux architectures: - x86_64 filters: event: pull_request tag_build: steps: - trigger_services: project: deepin:Unstable:dde package: %{SCM_REPOSITORY_NAME} filters: event: tag_push commit_build: steps: - trigger_services: project: deepin:Develop:dde package: %{SCM_REPOSITORY_NAME} filters: event: push qt5platform-plugins-5.7.12/.project000066400000000000000000000002321476226662200172240ustar00rootroot00000000000000 { "type": "homebrew" "3rdparty": ["3rdparty", "qt5platform-plugins/xcb/libqt5xcbqpa-dev/"], "ignore": [], "license": [] } qt5platform-plugins-5.7.12/.reuse/000077500000000000000000000000001476226662200167615ustar00rootroot00000000000000qt5platform-plugins-5.7.12/.reuse/dep5000066400000000000000000000045361476226662200175510ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: qt5platform-plugins Upstream-Contact: UnionTech Software Technology Co.,Ltd. <> Source: https://github.com/linuxdeepin/qt5platform-plugins # Config files Files: .gitignore clog.toml .clog.toml .gitlab-ci.yml .project qt5platform-plugins.pro CHANGELOG.md misc/*.xml src/*.pri Copyright: None License: CC0-1.0 # Readme Files: *.md Copyright: None License: CC0-1.0 # debian Files: debian/* Copyright: None License: CC0-1.0 # ci Files: .github/* .obs/workflows.yml linglong.yaml .syncexclude Copyright: None License: CC0-1.0 # archlinux Files: archlinux/* Copyright: None License: CC0-1.0 # rpm Files: rpm/* Copyright: None License: CC0-1.0 # dwayland config Files: wayland/dwayland/*.json wayland/dwayland/*.pro Copyright: None License: CC0-1.0 # wayland-shell config Files: wayland/wayland-shell/*.json wayland/wayland-shell/*.pro wayland/wayland-shell/*.pri wayland/wayland-shell/config.tests/deepin-kwin-test/*.pro wayland/wayland-shell/config.tests/wayland-test/*.pro Copyright: None License: CC0-1.0 # qtwayland-dev autogen Files: wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/wayland-* wayland/qtwayland-dev/5.*/QtWaylandClient/private/wayland-* Copyright: None License: CC0-1.0 # wayland config Files: wayland/README.md wayland/*.pro Copyright: None License: CC0-1.0 # xcb config Files: xcb/*.json xcb/*.pri xcb/*.pro xcb/README.md Copyright: None License: CC0-1.0 # xcb resource Files: xcb/cursors/* Copyright: Uniontech Software Technology Co.,Ltd. License: GPL-3.0-only # 3rdparty-kim Files: xcb/3rdparty/clientwin.* Copyright: Kim woelders License: LicenseRef-Xorg-Xwd-License # 3rdparty-TOG Files: xcb/3rdparty/dsimple.* Copyright: The Open Group License: LicenseRef-Xorg-Xwd-License # 3rdparty-License Files: xcb/3rdparty/*.txt Copyright: None License: CC0-1.0 # qt-oldfile-1 Files: xcb/libqt5xcbqpa-dev/5.3.*/* xcb/libqt5xcbqpa-dev/5.4.*/* xcb/libqt5xcbqpa-dev/5.5.*/* xcb/libqt5xcbqpa-dev/5.6.*/* xcb/libqt5xcbqpa-dev/5.7.*/* Copyright: Digia Plc and/or its subsidiary(-ies) License: LGPL-2.1-only or GPL-3.0-only # qt-oldfile-2 Files: xcb/libqt5xcbqpa-dev/5.1*.*/* xcb/libqt6xcbqpa-dev/6.*.*/* Copyright: The Qt Company Ltd. License: LicenseRef-Qt-Commercial or LGPL-3.0-only or GPL-2.0-only or GPL-3.0-or-later Files: toolGenerate/**/* Copyright: None License: CC0-1.0 qt5platform-plugins-5.7.12/.syncexclude000066400000000000000000000003501476226662200201050ustar00rootroot00000000000000# Paths that will be exclude from synchronize workflow # Please use relative path which use project directory as root # Notice that # * .git # * debian # * archlinux # * .obs # * .github # are always ignored linglong.yaml qt5platform-plugins-5.7.12/CHANGELOG.md000066400000000000000000000622741476226662200174040ustar00rootroot00000000000000 ## 1.2.2 (2019-05-29) #### Features * support the 16bits/30bits image formats ([c50d83ef](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c50d83efa671780fd91ae73ef86ac31fb5256292)) ## 1.2.1 (2019-05-23) #### Features * add new Qt private component for Qt 5.13+ ([796ad523](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/796ad5235fec4ac83b734f2876614fd8eb7b3c2b)) * support Qt 15.12.1/15.12.2/15.12.3 ([ee3e4c8a](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ee3e4c8a965b4e0a7b920ac8bcf8af96ff47f5b2)) #### Bug Fixes * It is easy to trigger resize when using the touch screen to move the window ([99e43da8](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/99e43da805ae29d078315dd23683d0277d0bb760)) * the window menu cannot hide ([a077611d](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/a077611df0469f498ebec29e566c68d260f10ddb)) * the foreign platform window screen is wrong ([6eac7834](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/6eac7834c93d54c9e9cbb18b155d0da1768ddf61)) ## 1.2.0 (2019-05-09) #### Bug Fixes * DForeignPlatformWindow have a wrong screen object ([49658492](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/4965849204cc5fa67fb207f136222af3e4f0b2a8)) * crash at DForeignPlatformWindow::handleConfigureNotifyEvent ([5ff0224a](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/5ff0224aeafb6ec6fb76c5ad5eb3351f6de883d4)) #### Others * correct a typo ([83f8d46c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/83f8d46c11ac2c3a58a53ec88db08fe7d72eaf8f)) ## 1.1.27 (2019-04-23) #### Bug Fixes * window can not get focus at mapped ([42684bc9](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/42684bc9dc937d0c1373d0d4d132391fa2118250)) * do not use methods because symbols are not exported ([07eb94cd](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/07eb94cd51ed05e83571c32b233ebf2e48e56700)) * compatibility with Qt 5.12+ ([b6355ce1](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b6355ce160c2ba48df7efb81a96a4a7f6d8923e6)) ## 1.1.26.1 (2019-04-22) #### Bug Fixes * failed on build(Qt 5.7.x) ([b7a973db](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b7a973dbd2a6ff086114aff01c9ff33f6e01cb17)) ## 1.1.26 (2019-04-17) #### Bug Fixes * Synchronize its screen object only when the native window is called directly on setScreen ([a5749da3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/a5749da392d77c8b92cf66480b52207af3c7452f)) * call QDeepinTheme::updateScaleLogcailDpi when screen added ([d4815e53](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/d4815e5306460133bf4018040d748940e35fa014)) * window shadow dislocation on multi-screen and the screens have different device pixel scale ratio ([d8013112](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/d8013112ee4635a5e5d6177321d6fb954246d53b)) ## 1.1.25 (2019-03-27) #### Bug Fixes * the window can not move ([2011cb3f](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/2011cb3fb31be1a5be540901a1af5b8c320b71e5)) ## 1.1.24 (2019-02-26) #### Bug Fixes * compatibility with Qt 5.12.1 ([1a9a05ef](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/1a9a05ef7942c91dafaf24023404aef9cbd77dbe)) * the minimized window can not active on 2D window manager ([c56c9949](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c56c9949384d51f4be13272898bd3f641c40081b)) ## 1.1.23 (2019-01-25) #### Bug Fixes * Fix window shadow drawing error if setting clip path ([c8b87b42](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c8b87b42a875eb6bbb506f0019d5ff4d4f580371)) ## 1.1.22 (2019-01-02) #### Bug Fixes * Does not reissue mouse press events when receiving an Ungrab type Enter event during mouse press ([e3569fe7](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e3569fe7a3b9b16f20fcc8cc7a793553fb87a2b4)) ## 1.1.21 (2018-12-27) #### Bug Fixes * the drag/drop is invalid if use DForeignPlatformWindow for target XWindow ([b4c0ece2](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b4c0ece2f2651f34c461aca6d478c1e41886fe1d)) ## 1.1.20 (2018-12-10) #### Bug Fixes * a typo ([c46eb749](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c46eb749f8a7118d8ce817e4f9cd63f529f52650)) ## 1.1.15 (2018-11-30) #### Bug Fixes * the Desktop application is not contains in current workspace ([e1d45711](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e1d45711fa14754cd72cff733a8a75f6d5a8efa6)) * support Qt version>=5.9.0 for DForeignPlatformWindow ([594f73e6](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/594f73e638da488efbdb4e518fb0f726b0ee09bc)) #### Features * add inteface: "windowManagerName" ([711e6aa1](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/711e6aa1dd119fdaaf196845733df67b7d0d6b20)) ## 1.1.14 (2018-11-19) #### Bug Fixes * build failed on low version gcc ([dce47ff6](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/dce47ff6aa4b34816c917cedd00e6c83048e540a)) ## 1.1.13 (2018-11-08) * refactor: set default border width to 1px of can not resize window ## 1.1.12 (2018-10-25) #### Bug Fixes * kwin not update blur ([58cda70e](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/58cda70e10f1de04cb76fd98c5724ccc0f99e592)) #### Features * support Qt 5.11.2 ([52e74b16](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/52e74b16f8fcf439f8b78807abdfb5b0d1c163ff)) ## 1.1.11 (2018-08-06) #### Features * support disable QPaintEngine features for QImage ([8e990f3a](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/8e990f3a46d70a2d88a18acf7493016f5c552c5b)) * support enable dxcb for the QWindow(the window had a platform-window) ([08c03f14](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/08c03f14dec7e355304c3cb1bbc0b39d64067f09)) ## 1.1.10 (2018-07-31) #### Bug Fixes * the shadow area will shake when the window is displayed ([9b10ea7d](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/9b10ea7dbeaf2699728d3ef94ae98c9baf5c13fa)) #### Features * add window property "_DEEPIN_DXCB_SHM_INFOS" ([e7ebe5d3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e7ebe5d3c93e436bc81e1a739820abefa28d1a79)) ## 1.1.9.2 (2018-07-19) #### Features * support Qt 5.11.1 ([c73177d7](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c73177d75a3ebc91ad6a24a0ea82ad2635ba160b)) * support Qt 5.11.0 ([f458b599](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/f458b59956fc34bc5d181842d065f37d4deac903)) #### Bug Fixes * click on the window without focus, resulting in maximization ([cfcc6a24](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/cfcc6a243832527c3c9e95408b150589fb8e5a4e)) ## 1.1.9.1 (2018-06-26) ## 1.1.9 (2018-06-25) #### Features * support XdndActionList ([b3bc3420](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b3bc3420dc81eb2066e03522d81c76660205cd50)) * support move window by touch event ([bd104d6c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/bd104d6c51da94b33ea64c71715d5ae1e949d9cd)) #### Bug Fixes * crash when add scroll device ([ee6ebb4a](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ee6ebb4a416c386ec1d32460a2caa0d486d7547b)) ## 1.1.8.8 (2018-06-07) #### Bug Fixes * revert the fix commit of QTBUG-53993 only in BypassWindowManagerHint window ([22ea6fc9](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/22ea6fc9b25e4f37df48d5b70b363cd29efe4f0f)) ## 1.1.8.7 (2018-06-07) #### Bug Fixes * can not get focus by mouse press on BypassWindowManagerHint window ([b7799256](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b779925639c51b9024023797c536bc7bd61805ec)) * build failures under Qt 5.11 ([3214457d](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/3214457d622b9ecbea2bcd11d8a3473aac3c0a5a)) ## 1.1.8.6 (2018-05-11) #### Bug Fixes * build failed on Qt 5.10.0 ([f6c86693](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/f6c866935f7833b60b0701360473762158d6a11f)) ## 1.1.8.5 (2018-05-04) #### Features * support window group leader ([398cf704](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/398cf704776d69b6e0c4b1d03827b91628cd9431)) * support Qt 5.9.4 ([8ada8d39](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/8ada8d39b33a4f66183549286132b19d9e352f84)) * support Qt 5.10.1 ([e476353b](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e476353bbcf68eb6474d837471a4d202fa76737a)) * add "inputEventSourceDevice" native platform function ([541fbc79](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/541fbc79d93b68cb3067ffba766f16d1e6583279)) * listen the DForeignPlatformWindow events ([09650c80](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/09650c8024fa0cb626ee86d7f9f5df4cdc4fe390)) #### Bug Fixes * frame window radius is wrong when the window state form Qt::WindowMaximized to Qt::WindowNoState ([ea9b1215](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ea9b12150fa2c4f4f494345d9210595c9b578432)) * crash in DPlatformWindowHelper::eventFilter if the event is DragLeave type ([5448b26f](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/5448b26f118470dec442f86b892649719030b273)) * rm .qmake.conf ([3ae6fd16](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/3ae6fd160f44a59f808cf5dac4f1817a4cb59bf8)) * can not ignore window close event ([a1d505e2](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/a1d505e2954be573a322238a312f24508a5a555a)) * the isWindowBlockedHandle function is stuck in an infinite loop ([7ce08107](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/7ce081076605db4e9cf9d2be5b2ae37adce1afff)) ## (2018-03-22) #### Bug Fixes * window setting Qt::WindowTransparentForInput flag is invalid ([475bc708](1.1.8.4/commit/475bc70832591da3ef9ca06ccbd328c033baefa3)) * clear the window blur areas when the window unmap ([482d26e1](1.1.8.4/commit/482d26e1854d27c055d97c5e223f29991f8efccd)) ## (2018-03-16) #### Bug Fixes * crash in DPlatformBackingStoreHelper::flush ([38d9dad0](1.1.8.3/commit/38d9dad077e127a64fbcf847a9c7cc1e31541473)) ## (2018-03-15) #### Bug Fixes * dframewindow timerEvent ([5afacaec](1.1.8.2/commit/5afacaec9839c898eebf4f120c9e44a9bae098b3)) * request active window is invalid ([ea8e7a13](1.1.8.2/commit/ea8e7a132aa603b9cf88b64d7fbc78d1c91249a3)) * window not receive Leave event when the window is covered by other windows ([2348e1c3](1.1.8.2/commit/2348e1c3ea1138850181a84571437690f48c9a25)) ## 1.1.8.1 (2018-03-08) #### Features * support disable change window cursor ([0fbb6f1c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/0fbb6f1cd56d8514f512f533893f115af93cca78)) #### Bug Fixes * crash on handlePropertyNotifyEvent ([ebb2b1a3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ebb2b1a32f53b2a6d888835ada88a4c98d5de537)) * window can not maximize ([da161585](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/da161585468526e8a821933d08e97b94c76d3e36)) * no leave event when window hide ([a2bd2498](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/a2bd24989a077dc058928bf58d0aefea4dc98f13)) * the window "_d_netWmStates" property is invalid ([f48df4c1](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/f48df4c139cc058cd6a8ac05d10245cdba715121)) * window fillet anti-aliasing ([ed29cca5](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ed29cca57544f2678bbc594fd7d7203d0d9ed933)) * blurred window sometimes does not take effect ([3aa09aa3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/3aa09aa3502e422395cc60acaa2797a15f0105c5)) * carsh on arm platform ([92d20f72](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/92d20f720331542891b04a738e42bc586064a322)) * optimize the effect of the window fillet ([40d298a7](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/40d298a7beeb7cad7e2f6bb5cadcfc79b8fdbbc2)) * window exists property on non-kwin windows _KDE_NET_WM_BLUR_BEHIND_REGION ([4cc89fcc](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/4cc89fccb8b7791bb349bdbfd0c08f744ab143e6)) ## 1.1.8 (2018-02-09) #### Bug Fixes * shadow image not repaint ([8cde9879](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/8cde9879cc74944c111e23a7c99634b0ab545e15)) * content window no clip ([359647c3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/359647c39c6220ecb6c44471b953d9bd248ce392)) ## 1.1.7 (2018-02-07) #### Features * set window radius to 0 when window maximzed ([35ef919c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/35ef919cb5dd6a50deff1e2f466bb141a4fc3424)) #### Bug Fixes * crash in DPlatformBackingStoreHelper::flush ([dbab1dc3](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/dbab1dc31e6a3129d2b688ede676679102c099f8)) * update copyright year ([422c0d2d](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/422c0d2d53a1452ff9b80f31c166a38db95daa38)) * shadow image size is wrong ([e537bcea](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e537bceab205b45f4f7dd5080213ab33ec0bd5bd)) * window radius not visible ([671b8894](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/671b8894667877e0b263234d2e91edecdcafab75)) * window can not get focus on Qt 5.9+ ([3c0a44bf](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/3c0a44bf9f8522ad820287d28d7b49bbeea32350)) * QGuiApplicationPrivate::lastCursorPosition on hiDPI window ([08755140](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/0875514090cf19e8129f1c6f08a42ac8c219bb3c)) * remove debug output in DPlatformBackingStoreHelper::flush ([c68032d9](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c68032d9cfe0e4e2fc6ef508908f53eec1f2a704)) * can not resize window by bottom/right ([e4c58d76](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e4c58d767d6e5b9fdd8805cec2449d3ddb2b5e0a)) * can not reisze window on openbox ([218df1e2](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/218df1e28708dbea9926eb0f94896d959744f7c3)) * content window position ([2439d675](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/2439d6753fdd3c6449b43c844f4191d0b60aa12b)) * set miniumu/maximum size inoperative for window ([0ad7e599](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/0ad7e59901db5d167227a6026623ffae678dab02)) * crash at VtableHook::overrideVfptrFun ([1a8e03cf](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/1a8e03cfb8574ac8df2e1f406b12568307943af1)) ## 1.1.6 (2017-12-28) #### Bug Fixes * send resize event to content window on frame window size changed ([fc88f619](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/fc88f6198c3273acc49f566f95efc459b5a357ba)) * the content window frame margins is invalid ([bb069366](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/bb069366555c07d1750f376677b20b19fa09e8d3)) * content window position is wrong at show ([2f74cd2c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/2f74cd2ce4db37009141d181f9752f3b124dee09)) * add break for switch/case ([ca84b062](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/ca84b0622ebee89d7454401d261f99f577850f36)) * fcitx input method can not work in QTextEdit ([cbd74f2a](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/cbd74f2a6a9f137d0081848a53a40bd50d350ca6)) * window blur area is a rounded rect if set clip path ([a89e7d0c](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/a89e7d0c035137bf1f85c7993eb14cb190f98ce0)) * LICENSE ([f8013823](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/f801382355dd62618fa0548c87cf6752b53673e8)) * after moving the window release the mouse and then move the mouse will receive a mouse release event ([10a73727](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/10a73727fe067bbe395d38c46890508ddd1ef559)) * Adapt lintian ([1f862c11](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/1f862c1175a2342520a3340621cb122e4478f88a)) * also search for libqt5xcbqpa private headers in system ([e47d510f](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/e47d510f9c2d371f59c33a290d27347840318f44)) * do not paint shadow on window maximized ([b1483de1](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/b1483de187d26ac360aa6b6f08469fad61b32077)) #### Features * eat focus event on grab/ungrab ([936da4ca](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/936da4ca99900ee4256ede4ca33b8767f189e5a2)) * support for Qt 5.10.0 ([247cabb7](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/247cabb70d2f97de4e6cec062e1106c9678d97a5)) ## 1.1.5 (2017-12-07) #### Bug Fixes * visable black border when maximize window ([9a25eccc](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/9a25eccc5e50ccd2cf196671d898ca83ed468f19)) * output "QPainter::begin: Paint device returned engine == 0, type: 3" ([d424dd61](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/d424dd61e2adc6cb4f96315354128751a2ac60cf)) ## 1.1.4 (2017-12-06) #### Features * support for Qt 5.9.3 ([32ec6503](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/32ec650304f12e3107c7dd13677c0cbb0afb1023)) #### Bug Fixes * compiling failed in Qt5.7.0 and above ([790377a5](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/790377a5ecadbcd86a0bb62bc71cf71144873984)) ## 1.1.3.1 (2017-12-06) #### Features * not clean when begin paint on opaque window ([635a8252](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/635a8252efe0500e2a299b0f336bab6b0362da1e)) #### Bug Fixes * visible lines at bottom/right on frame window ([40f53663](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/40f536630fac0222f6e2ae29d0cfcd604f9e6b77)) * content window area path on window maximized/fullscreen ([4dd1dc20](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/4dd1dc204125a62137ad735bc8e387ef0150314b)) * mouse position error on automatic adsorption ([196e34cb](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/196e34cbade9e665b4b766e9c62332930cb34f54)) ## 1.1.3 (2017-11-28) #### Features * add native function: popupSystemWindowMenu ([0e741b1e](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/0e741b1ef87e77df108c9cccd3fb24e5a9010a88)) * add showWindowSystemMenu function ([915c6d3f](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/915c6d3f75723c4574c00a786511ea098345d0d8)) * support for Qt 5.9.2 ([715bb1e4](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/715bb1e411ebf5283a4aec5416c9b7d19d09a55d)) #### Bug Fixes * window vaild path is empty ([c2b1a1b5](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/c2b1a1b52324f668a45213bebf1282aeec2c64e2)) * blur area overstep the content window area ([69f5edef](https://github.com/linuxdeepin/qt5dxcb-plugin/commit/69f5edef4453780c1566bc000b63307a5417b14d)) ## 1.1.2 (2017-11-16) #### Features * support set the window radius for QOpenGLWindow ([431fa688](https://github.com/linuxdeepin/qt5integration/commit/431fa688a6fad3a5057c89396342dfcc53987b04)) * use fake platform name when set DXCB_FAKE_PLATFORM_NAME_XCB ([471216b2](https://github.com/linuxdeepin/qt5integration/commit/471216b22d3ab08129d6d6e5c9e47696947adaaa)) #### Bug Fixes * the drag window position when dragging from one screen to another ([3905a0a0](https://github.com/linuxdeepin/qt5integration/commit/3905a0a02e1f17092b6c324516ae130172e247c9)) * the DFrameWindow's border path is wrong ([4882b916](https://github.com/linuxdeepin/qt5integration/commit/4882b91676593eadb8dcc98fb2a86ae82d0fe87a)) * the content window screen is wrong ([20f7695f](https://github.com/linuxdeepin/qt5integration/commit/20f7695f59a3a07981fc9bc5dde874385e215328)) * update screen for content window when the frame window screen changed ([f40a66ab](https://github.com/linuxdeepin/qt5integration/commit/f40a66abdaea1af1d8c00079717dc8d8c2622748)) * can not move window on openbox wm ([af64d84d](https://github.com/linuxdeepin/qt5integration/commit/af64d84dfc7d98e2bf5b8ea5a11507e200111431)) ## 1.1.1 (2017-11-10) #### Bug Fixes * crash on use the QWebEngineView ([c13bdeee](https://github.com/linuxdeepin/qt5integration/commit/c13bdeee242b0cbfebef78df925028f285913f2c)) * mouse enter of the window to receive the mouse to release the event ([7a6989e5](https://github.com/linuxdeepin/qt5integration/commit/7a6989e5cf8a2be0cc84644c9289e647704b06c6)) * mouse over the right border of the window to receive the mouse to leave the event ([cad2e037](https://github.com/linuxdeepin/qt5integration/commit/cad2e0379abf745e5d59fbca5902a1008edfff4f)) ## 1.1 (2017-11-06) #### Features * print info on create new window ([b68d0371](https://github.com/linuxdeepin/qt5integration/commit/b68d03713feb1d77640b35891e38e05736becba9)) #### Bug Fixes * update the content window clip path by it size ([070e3bc4](https://github.com/linuxdeepin/qt5integration/commit/070e3bc4d9c715d1c8c4e1531077286c43658815)) * the content window position is wrong when content margins hint changed ([9b1a28e6](https://github.com/linuxdeepin/qt5integration/commit/9b1a28e65d60e7286687943511a58485e0937bf5)) * window focus out when mouse leave ([14c14df2](https://github.com/linuxdeepin/qt5integration/commit/14c14df2c7a92be746d5479558ae2c61765052a9)) * the DFrameWindow's shadow and border ([e35a87a9](https://github.com/linuxdeepin/qt5integration/commit/e35a87a93872acde909383b6f5b4ca3baf63bfe5)) * the chile window is blocked by modal window ([db20016c](https://github.com/linuxdeepin/qt5integration/commit/db20016c6baa38ea561cddb9a3676252a19d8af6)) * warning: "W: Ignoring Provides line with non-equal DepCompareOp for package dde-qt5integration" for apt-get ([a074941e](https://github.com/linuxdeepin/qt5integration/commit/a074941e238476cf5e93fe2400e72d0901474d64)) * disable update frame mask ([5d136679](https://github.com/linuxdeepin/qt5integration/commit/5d136679f4886523dc3bc779ac8d0347611028bc)) * can not install ([1ac9975a](https://github.com/linuxdeepin/qt5integration/commit/1ac9975a9169b47f185ef5e33d79e3e2de2dbc50)) ## 1.0 (2017-11-02) #### Others * setup .clog.toml ([d5d065d4](https://github.com/linuxdeepin/qt5integration/commit/d5d065d4099973a2d82aca0e16acd26c99621bd9)) #### Features * keep the window border is 1px for hiDPI ([da8040c4](https://github.com/linuxdeepin/qt5integration/commit/da8040c42df0cbde97e21693f472a288ef46a9d8)) * QMenu hiDPI support ([a045b17e](https://github.com/linuxdeepin/qt5integration/commit/a045b17e86735779b48ea734bd18f2b2e25b4251)) * **style:** override drawItemPixmap ([a580b9bf](https://github.com/linuxdeepin/qt5integration/commit/a580b9bf2024cc5e9564283f4880229bac1d780a)) * **theme plugin:** read settings from config file ([aacc2995](https://github.com/linuxdeepin/qt5integration/commit/aacc299512f4006ff174c5700d471d344d7155d0)) * **theme style:** auto update the widgets font when theme config file changed ([d478074e](https://github.com/linuxdeepin/qt5integration/commit/d478074e73d8e22e2d70080ad1430c565261d9af)) #### Bug Fixes * set cursor is invaild ([a2e235be](https://github.com/linuxdeepin/qt5integration/commit/a2e235bed7873d35030be380e8cd73acc0192e89)) * menu can not hide on dde-dock ([ecae595e](https://github.com/linuxdeepin/qt5integration/commit/ecae595e29f1da24654c3128f13321c22412a7bd)) * compatibility with Qt 5.7.1+ ([774ffb89](https://github.com/linuxdeepin/qt5integration/commit/774ffb89733232b8728b897b58db3eab6c7a6e05)) * **dxcb:** * crash when screen changed ([7e1627c2](https://github.com/linuxdeepin/qt5integration/commit/7e1627c20fd92d7b4c1d7a69c55b4de5869cf6b6)) * the window border size is wrong ([83d6ac50](https://github.com/linuxdeepin/qt5integration/commit/83d6ac500b7e070f5c97ff220da16736229fd060)) * draw shadow area ([284cae9d](https://github.com/linuxdeepin/qt5integration/commit/284cae9dd90e9b9d7af92480e3a0e217a7c5f478)) * the DFrameWindow shadow area ([6e9c8274](https://github.com/linuxdeepin/qt5integration/commit/6e9c8274ef871fe3fa48a60a0861a96b6880dbf0)) * update the DFrameWindow's positionAutomatic value ([f6331ee3](https://github.com/linuxdeepin/qt5integration/commit/f6331ee32809d7e548b7d538beefc7ea5582f111)) * update the content window motif hints on propagateSizeHints/setVisible ([4e490995](https://github.com/linuxdeepin/qt5integration/commit/4e490995f5cfb564dbec705af114467c0ed374f0)) * the DFrameWindow's transientParent is self ([d5d93dba](https://github.com/linuxdeepin/qt5integration/commit/d5d93dbae8cdc21e887da17b8d710b0403f3b0aa)) * **style:** * update all widgets on font changed ([0e28f244](https://github.com/linuxdeepin/qt5integration/commit/0e28f244217f57d454424cc7dfba488ee6be93e3)) * update all widgets on font changed ([d4a65deb](https://github.com/linuxdeepin/qt5integration/commit/d4a65deb9e21e18390447c8b26eb429843333be4)) * **theme:** * "DFileSystemWatcherPrivate::addPaths: inotify_add_watch failed" ([a0322a68](https://github.com/linuxdeepin/qt5integration/commit/a0322a68447b7d918af49fbba23ebe1d5f53da25)) * set ini codec to "utf8" for QSettings ([3a4f7d76](https://github.com/linuxdeepin/qt5integration/commit/3a4f7d7651f6c433ef9735426d936289ac04d6c9)) qt5platform-plugins-5.7.12/CMakeLists.txt000066400000000000000000000030571476226662200203250ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later cmake_minimum_required(VERSION 3.13) set(DTK_VERSION "5.6.8" CACHE STRING "define project version" ) project(qt5platform-plugins VERSION ${DTK_VERSION} DESCRIPTION "DTK platform plugin module" HOMEPAGE_URL "https://github.com/linuxdeepin/qt5platform-plugins" LANGUAGES CXX C ) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) endif () include(GNUInstallDirs) include(CMakePackageConfigHelpers) if("${PROJECT_VERSION_MAJOR}" STREQUAL "5") set(QT_VERSION_MAJOR "5") elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6") set(QT_VERSION_MAJOR "6") set(DTK_VERSION_MAJOR "6") else() message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.") endif() message(${PROJECT_VERSION_MAJOR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(REQUIRED_QT_VERSION 5.15.0) if (CMAKE_BUILD_TYPE STREQUAL "Debug") set(BUILD_TESTING ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fno-omit-frame-pointer") else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast") endif () set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/plugins/platforms) add_subdirectory(xcb) if("${PROJECT_VERSION_MAJOR}" STREQUAL "5") add_subdirectory(wayland) endif() if(BUILD_TESTING) enable_testing() add_subdirectory(tests) endif() message(${PROJECT_VERSION_MAJOR}) qt5platform-plugins-5.7.12/LICENSE000066400000000000000000001221631476226662200165720ustar00rootroot00000000000000GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . qt5platform-plugins-5.7.12/LICENSES/000077500000000000000000000000001476226662200167655ustar00rootroot00000000000000qt5platform-plugins-5.7.12/LICENSES/CC0-1.0.txt000066400000000000000000000156101476226662200203720ustar00rootroot00000000000000Creative 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. qt5platform-plugins-5.7.12/LICENSES/GPL-2.0-only.txt000066400000000000000000000416711476226662200214350ustar00rootroot00000000000000GNU 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. 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 an idea of what it does. Copyright (C) yyyy 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 qt5platform-plugins-5.7.12/LICENSES/GPL-3.0-only.txt000066400000000000000000001035561476226662200214370ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . qt5platform-plugins-5.7.12/LICENSES/GPL-3.0-or-later.txt000066400000000000000000001035561476226662200222030ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . qt5platform-plugins-5.7.12/LICENSES/LGPL-2.1-only.txt000066400000000000000000000625571476226662200215600ustar00rootroot00000000000000GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. 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 not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the 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 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library's name and an idea of what it does. Copyright (C) year name of author This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; 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. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice That's all there is to it! qt5platform-plugins-5.7.12/LICENSES/LGPL-3.0-only.txt000066400000000000000000001221621476226662200215450ustar00rootroot00000000000000GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . qt5platform-plugins-5.7.12/LICENSES/LGPL-3.0-or-later.txt000066400000000000000000001221621476226662200223110ustar00rootroot00000000000000GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . qt5platform-plugins-5.7.12/LICENSES/LicenseRef-Qt-Commercial.txt000066400000000000000000000007161476226662200242040ustar00rootroot00000000000000Licensees holding valid commercial Qt licenses may use this software in accordance with the the terms contained in a written agreement between you and The Qt Company. Alternatively, the terms and conditions that were accepted by the licensee when buying and/or downloading the software do apply. For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions. For further information use the contact form at https://www.qt.io/contact-us. qt5platform-plugins-5.7.12/LICENSES/LicenseRef-Xorg-Xwd-License.txt000066400000000000000000000044161476226662200246070ustar00rootroot00000000000000Copyright 1987, 1988, 1993, 1994, 1996, 1998 The Open Group Copyright 1994 Hewlett-Packard Co. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP 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. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 2007 Kim woelders Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.qt5platform-plugins-5.7.12/README.md000066400000000000000000000052561476226662200170470ustar00rootroot00000000000000# qt5platform-plugins qt5platform-plugins is the Qt platform integration plugin for Deepin Desktop Environment. ## Dependencies ### Build dependencies * pkg-config * mtdev * xcb-xkb * xcb-render-util * xcb-image * xcb-icccm4 * xcb-keysyms1-dev * egl1-mesa * xkbcommon-x11 * dbus-1 * udev * xrender * xi * sm * xcb-xinerama * fontconfig * freetype6 * glib2.0 * xcb-damage * xcb-composite * cairo2 * Qt5 (>= 5.6) * Qt5-Core * Qt5-Gui * Qt5-OpenGL * Qt5-X11extras * Qt5-Core-Private ## Installation ### Build from source code 1. Make sure you have installed all dependencies. 2. Build: Support disabling some modules, add CONFIG+= when executing qmake. val: - DISABLE_WAYLAND - DISABLE_XCB ``` mkdir build cd build qmake .. make ``` 3. Install: ``` $ sudo make install ``` ## Usage To be done. ## Getting help You may also find these channels useful if you encounter any other issues: * [Telegram group](https://t.me/deepin) * [Matrix](https://matrix.to/#/#deepin-community:matrix.org) * [IRC (libera.chat)](https://web.libera.chat/#deepin-community) * [Official Forum](https://bbs.deepin.org/) * [Wiki](https://wiki.deepin.org/) ## Getting involved We encourage you to report issues and contribute changes * [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en). ## License qt5platform-plugins is licensed under [LGPL-3.0-or-later](LICENSE). ## Environment variable * DXCB_PRINT_WINDOW_CREATE: Print the information of the QWindow when the local window is created * DXCB_PAINTENGINE_DISABLE_FEATURES: Specify the qpaintengine:: paintenginefeatures to disable, which is only valid for the QPainter drawing system * DXCB_FAKE_PLATFORM_NAME_XCB: Force the value of qguiapplication:: platformname property to be "xcb" * DXCB_DISABLE_HOOK_CURSOR: It is prohibited to use the value of qwindow:: devicepixelratio to automatically scale the size of the cursor on this window * DXCB_REDIRECT_CONTENT: Set whether to allow XDamage to redirect the content drawn in the window with dxcb mode enabled. "true" indicates that it is allowed, and "false" indicates that it is not allowed. Otherwise, the value set by the window itself will be used. If the window does not set any value, the redirection mode will be enabled when the surface type of the window is QSurface:: OpenGLSurface. Otherwise, it will not be enabled * DXCB_REDIRECT_CONTENT_WITH_NO_COMPOSITE: It is mandatory to allow the content drawn in the XDamage redirected window in the mode without window effects. If it is not set or the value is empty, the content drawn in the XDamage redirected window will not be used if the window manager does not support Composite qt5platform-plugins-5.7.12/README.zh_CN.md000066400000000000000000000046321476226662200200440ustar00rootroot00000000000000# qt5platform-plugins qt5platform-plugins 插件是用于深度桌面环境的Qt平台集成插件. ## 依赖 ### 编译依赖 * pkg-config * mtdev * xcb-xkb * xcb-render-util * xcb-image * xcb-icccm4 * xcb-keysyms1-dev * egl1-mesa * xkbcommon-x11 * dbus-1 * udev * xrender * xi * sm * xcb-xinerama * fontconfig * freetype6 * glib2.0 * xcb-damage * xcb-composite * cairo2 * Qt5 (>= 5.6) * Qt5-Core * Qt5-Gui * Qt5-OpenGL * Qt5-X11extras * Qt5-Core-Private * Qt >= 5.10 ## 安装 ### 从源代码构建 1. 确保已经安装了所有的编译依赖. 2. 构建: 在qmake时添加配置`add CONFIG+=`,可以手动禁用某些模块. val: - DISABLE_WAYLAND - DISABLE_XCB ```bash mkdir build cd build qmake .. make ``` 3. 安装: ```bash sudo make install ``` ## 用法 待补充. ## 帮助 任何使用问题都可以通过以下方式寻求帮助: * [Telegram 群组](https://t.me/deepin) * [Matrix](https://matrix.to/#/#deepin-community:matrix.org) * [IRC (libera.chat)](https://web.libera.chat/#deepin-community) * [Forum](https://bbs.deepin.org) * [WiKi](https://wiki.deepin.org/) ## 参与贡献 我们鼓励您报告问题并作出更改 * [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) ## 协议 qt5platform-plugins遵循协议 [LGPL-3.0-or-later](LICENSE). ## 环境变量 * DXCB_PRINT_WINDOW_CREATE 在本地窗口被创建时打印对应的 QWindow 的信息 * DXCB_PAINTENGINE_DISABLE_FEATURES 指定要禁用的 QPaintEngine::PaintEngineFeatures,只对 QPainter 绘图系统有效 * DXCB_FAKE_PLATFORM_NAME_XCB 将 QGuiApplication::platformName 属性的值将被强制设置为 "xcb" * DXCB_DISABLE_HOOK_CURSOR 禁止使用 QWindow::devicePixelRatio 的值自动缩放光标在此窗口上的大小 * DXCB_REDIRECT_CONTENT 设置是否允许对开启了 dxcb 模式的窗口使用 XDamage 重定向窗口绘制的内容,值为 "true" 表示允许,值为 "false" 表示不允许。否则将使用窗口自己设置的值,如果窗口未设置任何值,则窗口的 surfaceType 为 QSurface::OpenGLSurface 时会开启重定向模式,否则不开启 * DXCB_REDIRECT_CONTENT_WITH_NO_COMPOSITE 强制允许在未开启窗口特效的模式下使用 XDamage 重定向窗口绘制的内容,未设置或值为空时,在窗口管理器不支持 Composite 的情况下,将不使用 XDamage 重定向窗口绘制的内容 qt5platform-plugins-5.7.12/archlinux/000077500000000000000000000000001476226662200175555ustar00rootroot00000000000000qt5platform-plugins-5.7.12/archlinux/PKGBUILD000066400000000000000000000017751476226662200207130ustar00rootroot00000000000000# Maintainer: justforlxz pkgname=deepin-qt5platform-plugins-git pkgver=5.0.40.r14.gf817781 pkgrel=1 sourcename=dde-qt5platform-plugins sourcetars=("$sourcename"_"$pkgver".tar.xz) sourcedir="qt5platform-plugins" pkgdesc='Qt platform plugins for DDE' arch=('x86_64' 'aarch64') url="https://github.com/linuxdeepin/qt5platform-plugins" license=('GPL3') provides=('deepin-qt5platform-plugins') conflicts=('deepin-qt5platform-plugins') depends=('cairo' 'qt5-wayland' 'qt5-x11extras' 'qt5-base' 'dwayland') makedepends=('git' 'expac' 'qt5-xcb-private-headers' 'libglvnd' 'ninja' 'cmake' 'libxcb' 'gtest' 'gmock' 'extra-cmake-modules') groups=('deepin-git') source=("${sourcetars[@]}") sha512sums=('SKIP') build() { cd $sourcedir cmake . -GNinja \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DQT_XCB_PRIVATE_HEADERS=/usr/include/qtxcb-private ninja } package() { cd $sourcedir DESTDIR="$pkgdir" ninja install } qt5platform-plugins-5.7.12/clog.toml000066400000000000000000000001661476226662200174040ustar00rootroot00000000000000[clog] repository = "https://github.com/linuxdeepin/qt5dxcb-plugin" from-latest-tag = true changelog = "CHANGELOG.md" qt5platform-plugins-5.7.12/debian/000077500000000000000000000000001476226662200170025ustar00rootroot00000000000000qt5platform-plugins-5.7.12/debian/changelog000066400000000000000000000173101476226662200206560ustar00rootroot00000000000000dde-qt5platform-plugins (5.7.12) unstable; urgency=medium * fix: ToolTip's xsettings can't work in qt6 * feat: Add files generated by qdbusXML2cpp and DCONG2cpp (#272) -- YeShanShan Thu, 06 Mar 2025 17:30:19 +0800 dde-qt5platform-plugins (5.7.11) unstable; urgency=medium * fix: DForeignWindow can't work in qt6 -- YeShanShan Thu, 27 Feb 2025 20:48:29 +0800 dde-qt5platform-plugins (5.7.10) unstable; urgency=medium * Release 5.7.10 -- YeShanShan Thu, 13 Feb 2025 17:19:06 +0800 dde-qt5platform-plugins (5.7.9) unstable; urgency=medium * chore: disable ut by default -- Deepin Packages Builder Thu, 23 Jan 2025 09:07:08 +0000 dde-qt5platform-plugins (5.7.8) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Tue, 14 Jan 2025 11:17:31 +0000 dde-qt5platform-plugins (5.7.7) unstable; urgency=medium * chore: mips64 disable compile unit test binaries mips64 disable compile unit test binaries * fix: after setting the cursor theme, it will not update in real-time. * fix: DNotitlebarWindowHelper can't be removed from mapped -- Deepin Packages Builder Thu, 09 Jan 2025 09:28:39 +0000 dde-qt5platform-plugins (5.7.6) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Thu, 02 Jan 2025 05:43:52 +0000 dde-qt5platform-plugins (5.7.5) unstable; urgency=medium * fix: app crashed when QBytearray reallocated -- Deepin Packages Builder Thu, 12 Dec 2024 03:03:54 +0000 dde-qt5platform-plugins (5.7.4) unstable; urgency=medium * fix: app crashed when window destroyed in quick * fix: hasVtable is incorrect when destructing * fix: app crashed when window destroyed in quick -- Deepin Packages Builder Tue, 03 Dec 2024 02:00:46 +0000 dde-qt5platform-plugins (5.7.3) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Wed, 20 Nov 2024 02:19:06 +0000 dde-qt5platform-plugins (5.7.2) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Wed, 13 Nov 2024 01:53:26 +0000 dde-qt5platform-plugins (5.7.1) unstable; urgency=medium * fix: 向日葵中点击文管窗口标题时直接进入移动窗口状态(Bug: 261679)(Influence: 窗口移动) * fix: 共享库二进制兼容(Bug: 261679) * fix: incorect window movement when selecting files(Issue: https://github.com/linuxdeepin/developer-center/issues/10165) -- Deepin Packages Builder Wed, 16 Oct 2024 03:30:45 +0000 dde-qt5platform-plugins (5.6.34) unstable; urgency=medium * feat: support to change window effects(Bug: 244347) * fix: compl error in deepin * chore: code style -- Deepin Packages Builder Tue, 20 Aug 2024 05:03:51 +0000 dde-qt5platform-plugins (5.6.32) unstable; urgency=medium * fix: window border properties cannot change in real time(Issue: https://github.com/linuxdeepin/developer-center/issues/8342)(Influence: 边界颜色,边框宽度,阴影颜色,偏移量等窗口属性能实时变化) -- Deepin Packages Builder Mon, 08 Jul 2024 02:29:21 +0000 dde-qt5platform-plugins (5.6.31) unstable; urgency=medium * feat: support to qt 6.7.1 * fix: change qt_assert to Q_ASSERT (#246) Thanks to Whale107 -- Deepin Packages Builder Thu, 27 Jun 2024 09:11:34 +0000 dde-qt5platform-plugins (5.6.30) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Thu, 30 May 2024 02:46:31 +0000 dde-qt5platform-plugins (5.6.29) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Mon, 13 May 2024 03:02:54 +0000 dde-qt5platform-plugins (5.6.28) unstable; urgency=medium * fix: Need link Qt6DBus library Thanks to Hillwood Yang -- Deepin Packages Builder Mon, 29 Apr 2024 08:23:39 +0000 dde-qt5platform-plugins (5.6.27) unstable; urgency=medium * fix: BlurArea unpack error in qt5 * fix: 修复阴影补偿属性无法设置的问题(Bug: 242761)(Influence: 阴影补偿属性) -- Deepin Packages Builder Fri, 19 Apr 2024 08:55:35 +0000 dde-qt5platform-plugins (5.6.26) unstable; urgency=medium [ root ] * UNRELEASED -- Deepin Packages Builder Tue, 26 Mar 2024 05:47:35 +0000 dde-qt5platform-plugins (5.6.25) unstable; urgency=medium * another clean fix for #231 (#232) Thanks to Keeyou * chore: avoid build error -- Deepin Packages Builder Mon, 11 Mar 2024 01:16:26 +0000 dde-qt5platform-plugins (5.6.22) unstable; urgency=medium * fix #7057 -- Mike Chen Thu, 25 Jan 2024 16:14:18 +0800 dde-qt5platform-plugins (5.6.21) unstable; urgency=medium * release 5.6.21 -- Mike Chen Tue, 16 Jan 2024 20:09:03 +0800 dde-qt5platform-plugins (5.6.20) unstable; urgency=medium * release 5.6.20 -- Deepin Packages Builder Wed, 29 Nov 2023 10:01:18 +0800 dde-qt5platform-plugins (5.6.16) unstable; urgency=medium * fix: ensue ddeshell failed * fix: typo ddeepin -> deepin * chore: change qmake to cmake (#185) Thanks to WangFei * chore: Add header files about xcb from Qt6 * chore: Support Qt6 * chore: set the default install prefix of cmake * chore: add the XcbQpaPrivate module in qt6 version * fix: application crashed when moving window * chore: resolve the warnings about deprecated-declarations * chore: resolve the warning from cmake * chore: Sync by https://github.com/linuxdeepin/.github/commit/559e91167d4919644f37bbcf123eb0651c1528ea(Influence: none) * fix: build failed in archlinux * chore: add unit test * fix: undefine symbol * fix: heap use after free * fix: unit test failed (setWindowRadius) * Revert "fix: unit test failed (setWindowRadius)" * fix: call setWindowRadius failed * chore: add unit test * chore: link to target directly on unit test * chore: Adapt to Qt 6.4.2 * fix: can't find qeventpoint_p.h in qt5 * chore: remove XcbQpaPrivate module on qt6 * chore: add dtkcommon depency -- Deepin Packages Builder Thu, 24 Aug 2023 15:47:39 +0800 dde-qt5platform-plugins (5.6.12) unstable; urgency=medium * Release 5.6.12 * FIX qt app server decoration not created in wayland -- Deepin Packages Builder Mon, 15 May 2023 11:32:41 +0800 dde-qt5platform-plugins (5.6.11) unstable; urgency=medium * Release 5.6.11 * FIX dtk#63 * FIX bug-195723 primary screen not right at startup -- Deepin Packages Builder Mon, 08 May 2023 13:57:30 +0800 dde-qt5platform-plugins (5.6.9) unstable; urgency=medium * Release 5.6.9 -- Deepin Packages Builder Mon, 03 Apr 2023 10:24:44 +0800 dde-qt5platform-plugins (5.6.5) unstable; urgency=medium * Release 5.6.5 -- Deepin Packages Builder Wed, 22 Feb 2023 14:17:33 +0800 dde-qt5platform-plugins (5.6.3) unstable; urgency=medium * Release 5.6.3 -- Deepin Packages Builder Mon, 12 Dec 2022 17:28:22 +0800 dde-qt5platform-plugins (5.0.71) unstable; urgency=medium * Release 5.0.71 -- Deepin Packages Builder Thu, 24 Nov 2022 13:34:12 +0800 dde-qt5platform-plugins (5.0.0-1) unstable; urgency=medium * Initial release -- Deepin Packages Builder Wed, 06 May 2020 11:59:02 +0800 qt5dxcb-plugin (1.0.0-1) unstable; urgency=medium * Initial release -- Deepin Packages Builder Tue, 08 Nov 2016 15:10:02 +0800 qt5platform-plugins-5.7.12/debian/compat000066400000000000000000000000021476226662200202000ustar00rootroot000000000000009 qt5platform-plugins-5.7.12/debian/control000066400000000000000000000025001476226662200204020ustar00rootroot00000000000000Source: dde-qt5platform-plugins Section: devel Priority: optional Maintainer: Deepin Packages Builder Build-Depends: debhelper (>=9), qtbase5-dev, qtbase5-private-dev, pkg-config, libqt5x11extras5-dev, libxcb-xkb-dev, libxcb-render-util0-dev, libxcb-image0-dev, libxcb-icccm4-dev, libxcb-keysyms1-dev, libegl1-mesa-dev, libmtdev-dev, libxkbcommon-x11-dev, libdbus-1-dev, libqt5opengl5-dev, libudev-dev, libxrender-dev,libxi-dev, libsm-dev, libxcb-xinerama0-dev, libfontconfig1-dev, libglib2.0-dev, libxcb-damage0-dev, libxcb-composite0-dev, libcairo2-dev, libkf5wayland-dev, libdwayland-dev, qtwayland5-private-dev | libqt5waylandclient5-dev, libwayland-dev, libxcb-xinput-dev, libxcb-util-dev | libxcb-util0-dev, libx11-xcb-dev, libxcb-sync-dev, libxcb-randr0-dev, cmake, libgtest-dev, libgmock-dev, libdtkcommon-dev(>=5.6.16) Standards-Version: 3.9.8 Package: dde-qt5xcb-plugin Architecture: any Provides: libqt5dxcb-plugin Conflicts: libqt5dxcb-plugin, qt5dxcb-plugin Breaks:dde-qt5integration (<< 0.2.8.1) Replaces: qt5dxcb-plugin Depends: ${shlibs:Depends}, ${misc:Depends} Description: Qt platform plugins Qt platform plugins for DDE. Package: dde-qt5wayland-plugin Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, qtwayland5 Description: Qt platform plugins Qt platform plugins for DDE. qt5platform-plugins-5.7.12/debian/copyright000066400000000000000000000017441476226662200207430ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: qt5integration Source: https://github.com/linuxdeepin/qt5integration Files: * Copyright: 2017 Deepin.Inc License: GPL-3+ This package 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 package 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 . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". qt5platform-plugins-5.7.12/debian/dde-qt5wayland-plugin.install000066400000000000000000000001661476226662200245140ustar00rootroot00000000000000/usr/lib/*/qt5/plugins/platforms/libdwayland.so /usr/lib/*/qt5/plugins/wayland-shell-integration/libkwayland-shell.so qt5platform-plugins-5.7.12/debian/dde-qt5xcb-plugin.install000066400000000000000000000000531476226662200236240ustar00rootroot00000000000000usr/lib/*/qt5/plugins/platforms/libdxcb.so qt5platform-plugins-5.7.12/debian/rules000077500000000000000000000001621476226662200200610ustar00rootroot00000000000000#!/usr/bin/make -f %: dh $@ override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info qt5platform-plugins-5.7.12/debian/source/000077500000000000000000000000001476226662200203025ustar00rootroot00000000000000qt5platform-plugins-5.7.12/debian/source/format000066400000000000000000000000151476226662200215110ustar00rootroot000000000000003.0 (native) qt5platform-plugins-5.7.12/linglong.yaml000066400000000000000000000007151476226662200202600ustar00rootroot00000000000000package: id: qt5platform-plugins name: qt5platform-plugins kind: lib version: 5.6.3 description: | Qt platform plugins for DDE. base: id: org.deepin.base/23.0.0 depends: - id: qtbase/5.15.7 - id: qttools/5.15.7 - id: qtx11extras/5.15.7 - id: qtsvg/5.15.7 - id: qtmultimedia/5.15.7 - id: qtwayland/5.15.7 - id: dwayland/5.24.3.1 - id: gsettings-qt/0.3.1 #- id: googletest/1.8.1 source: kind: local build: kind: qmake qt5platform-plugins-5.7.12/misc/000077500000000000000000000000001476226662200165135ustar00rootroot00000000000000qt5platform-plugins-5.7.12/misc/com.deepin.im.xml000066400000000000000000000017001476226662200216600ustar00rootroot00000000000000 qt5platform-plugins-5.7.12/misc/org.freedesktop.DBus.xml000066400000000000000000000046371476226662200232040ustar00rootroot00000000000000 qt5platform-plugins-5.7.12/rpm/000077500000000000000000000000001476226662200163565ustar00rootroot00000000000000qt5platform-plugins-5.7.12/rpm/qt5platform-plugins.spec000066400000000000000000000050101476226662200231630ustar00rootroot00000000000000%define specrelease 12%{?dist} %if 0%{?openeuler} %define specrelease 1 %endif Name: dde-qt5platform-plugins Version: 5.0.25.1 Release: %{specrelease} Summary: Qt platform plugins for DDE License: GPLv3 URL: https://github.com/linuxdeepin/deepin-desktop-schemas Source0: %{name}-%{version}.tar.gz %description %{summary}. %package -n dde-qt5xcb-plugin Summary: %{summary} BuildRequires: qt5-devel BuildRequires: git BuildRequires: qt5-qtwayland-devel BuildRequires: qt5-qtdeclarative-devel BuildRequires: wayland-devel #BuildRequires: dde-waylandserver-devel #BuildRequires: dde-waylandclient-devel BuildRequires: xcb-util-image-devel BuildRequires: xcb-util-renderutil-devel BuildRequires: libxcb-devel BuildRequires: xcb-util-wm-devel BuildRequires: mtdev-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: dbus-devel BuildRequires: systemd-devel BuildRequires: libXrender-devel BuildRequires: libXi-devel BuildRequires: libSM-devel BuildRequires: libxcb-devel BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: libxcb-devel BuildRequires: cairo-devel BuildRequires: kf5-kwayland-devel BuildRequires: libqtxdg-devel BuildRequires: dtkwidget-devel BuildRequires: pkg-config BuildRequires: mtdev-devel BuildRequires: xcb-util-keysyms-devel Provides: qt5dxcb-plugin Obsoletes: qt5dxcb-plugin %description -n dde-qt5xcb-plugin %{summary}. %package -n dde-qt5wayland-plugin Summary: %{summary} BuildRequires: qt5-devel BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtbase-static BuildRequires: libqtxdg-devel BuildRequires: dtkwidget-devel BuildRequires: pkg-config BuildRequires: qt5-qtx11extras-devel BuildRequires: qt5-qtsvg-devel BuildRequires: mtdev-devel BuildRequires: qt5-qtmultimedia-devel %description -n dde-qt5wayland-plugin %{summary}. %prep %autosetup sed -i 's|wayland/wayland.pro|#wayland/wayland.pro|' qt5platform-plugins.pro %build # help find (and prefer) qt5 utilities, e.g. qmake, lrelease export PATH=%{_qt5_bindir}:$PATH mkdir build && pushd build %qmake_qt5 ../ %make_build popd %install %make_install -C build INSTALL_ROOT="%buildroot" %files -n dde-qt5xcb-plugin %{_libdir}/qt5/plugins/platforms/libdxcb.so %files -n dde-qt5wayland-plugin #%{_libdir}/qt5/plugins/platforms/libdwayland.so #%{_libdir}/qt5/plugins/wayland-shell-integration/libkwayland-shell.so %changelog * Tue Apr 21 2021 uoser - 5.0.25.1-1 - update to 5.0.25.1-1qt5platform-plugins-5.7.12/src/000077500000000000000000000000001476226662200163475ustar00rootroot00000000000000qt5platform-plugins-5.7.12/src/dapplicationeventmonitor.cpp000066400000000000000000000047721476226662200242060ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dapplicationeventmonitor.h" #include #include #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #include typedef QPointingDevice QTouchDevice; #else #include #endif DPP_BEGIN_NAMESPACE DApplicationEventMonitor::DApplicationEventMonitor(QObject *parent) : QObject(parent) , m_lastInputDeviceType(None) { qApp->installEventFilter(this); } DApplicationEventMonitor::~DApplicationEventMonitor() { } DApplicationEventMonitor::InputDeviceType DApplicationEventMonitor::lastInputDeviceType() const { return m_lastInputDeviceType; } DApplicationEventMonitor::InputDeviceType DApplicationEventMonitor::eventType(QEvent *event) { Q_ASSERT(event); InputDeviceType last_input_device_type = None; switch (event->type()) { case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseMove: case QEvent::MouseButtonDblClick: { QMouseEvent *pMouseEvent = static_cast(event); if (pMouseEvent->source() == Qt::MouseEventNotSynthesized) { //由真实鼠标事件生成 last_input_device_type = Mouse; } break; } case QEvent::TabletPress: case QEvent::TabletRelease: case QEvent::TabletMove: last_input_device_type = Tablet; break; case QEvent::KeyPress: case QEvent::KeyRelease: last_input_device_type = Keyboard; break; case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: case QEvent::TouchCancel: { QTouchEvent *pTouchEvent = static_cast(event); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) if (pTouchEvent->device()->type() == QInputDevice::DeviceType::TouchScreen) { #else if (pTouchEvent->device()->type() == QTouchDevice::TouchScreen) { #endif last_input_device_type = TouchScreen; } break; } default: break; } return last_input_device_type; } bool DApplicationEventMonitor::eventFilter(QObject *watched, QEvent *event) { auto last_input_device_type = eventType(event); if (last_input_device_type != None && last_input_device_type != m_lastInputDeviceType) { m_lastInputDeviceType = last_input_device_type; Q_EMIT lastInputDeviceTypeChanged(); } return QObject::eventFilter(watched, event); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dapplicationeventmonitor.h000066400000000000000000000017551476226662200236510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DAPPLICATIONEVENTMONITOR_H #define DAPPLICATIONEVENTMONITOR_H #include "global.h" #include #include DPP_BEGIN_NAMESPACE class DApplicationEventMonitor : public QObject { Q_OBJECT public: enum InputDeviceType { None = 0, // 初始状态 Mouse = 1, //鼠标 Tablet = 2, //平板外围设备 Keyboard = 3, //键盘 TouchScreen = 4 //触摸屏 }; DApplicationEventMonitor(QObject *parent = nullptr); ~DApplicationEventMonitor() override; InputDeviceType lastInputDeviceType() const; protected: bool eventFilter(QObject *watched, QEvent *event) override; private: static InputDeviceType eventType(QEvent *type); signals: void lastInputDeviceTypeChanged(); private: InputDeviceType m_lastInputDeviceType; }; DPP_END_NAMESPACE #endif // DAPPLICATIONEVENTMONITOR_H qt5platform-plugins-5.7.12/src/dbackingstoreproxy.cpp000066400000000000000000000225151476226662200230010ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dbackingstoreproxy.h" #include "dopenglpaintdevice.h" #include #include #include #include #include #include #include #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if __has_include("utility.h") #define __D_HAS_UTILITY__ #endif #else #if QT_HAS_INCLUDE("utility.h") #define __D_HAS_UTILITY__ #endif #endif #ifdef __D_HAS_UTILITY__ #include "utility.h" #include "dwmsupport.h" #else #define DISABLE_WALLPAPER #endif #define HEADER_SIZE 16 DPP_BEGIN_NAMESPACE bool DBackingStoreProxy::useGLPaint(const QWindow *w) { #ifndef QT_NO_OPENDL if (!w->supportsOpenGL()) return false; if (qEnvironmentVariableIsSet("D_NO_OPENGL") || qEnvironmentVariableIsSet("D_NO_HARDWARE_ACCELERATION")) return false; bool envIsIntValue = false; bool forceGLPaint = qEnvironmentVariableIntValue("D_USE_GL_PAINT", &envIsIntValue) == 1; QVariant value = w->property(enableGLPaint); if (envIsIntValue && !forceGLPaint) { return false; } return value.isValid() ? value.toBool() : forceGLPaint; #else return false; #endif } bool DBackingStoreProxy::useWallpaperPaint(const QWindow *w) { return w->property("_d_dxcb_wallpaper").isValid(); } DBackingStoreProxy::DBackingStoreProxy(QPlatformBackingStore *proxy, bool useGLPaint, bool useWallpaper) : QPlatformBackingStore(proxy->window()) , m_proxy(proxy) , enableGL(useGLPaint) , enableWallpaper(useWallpaper) { #ifndef DISABLE_WALLPAPER if (useWallpaper) { QObject::connect(DXcbWMSupport::instance(), &DXcbWMSupport::hasWallpaperEffectChanged, window(), &QWindow::requestUpdate); QObject::connect(DXcbWMSupport::instance(), &DXcbWMSupport::wallpaperSharedChanged, window(), [ this ] { updateWallpaperShared(); }); updateWallpaperShared(); } #endif } DBackingStoreProxy::~DBackingStoreProxy() { delete m_proxy; if (m_sharedMemory != nullptr) delete m_sharedMemory; } QPaintDevice *DBackingStoreProxy::paintDevice() { if (glDevice) return glDevice.data(); return !m_image.isNull()? &m_image : m_proxy->paintDevice(); } void DBackingStoreProxy::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { if (glDevice) return glDevice->flush(); if (!m_image.isNull()) { QRegion expand_region; for (const QRect &r : region) { expand_region += r.adjusted(-1, -1, 1, 1); } m_proxy->flush(window, expand_region, offset); } else { // 未开启缩放补偿 m_proxy->flush(window, region, offset); } } #ifndef QT_NO_OPENGL #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) void DOpenGLBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context) { m_proxy->composeAndFlush(window, region, offset, textures, context); } #elif QT_VERSION < QT_VERSION_CHECK(5, 10, 0) void DOpenGLBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) { m_proxy->composeAndFlush(window, region, offset, textures, context, translucentBackground); } #elif QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) void DBackingStoreProxy::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) { m_proxy->composeAndFlush(window, region, offset, textures, translucentBackground); } #else QPlatformBackingStore::FlushResult DBackingStoreProxy::rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) { return m_proxy->rhiFlush(window, sourceDevicePixelRatio, region, offset, textures, translucentBackground); } #endif #if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) GLuint DBackingStoreProxy::toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const { return m_proxy->toTexture(dirtyRegion, textureSize, flags); } #else QRhiTexture *DBackingStoreProxy::toTexture(QRhiResourceUpdateBatch *resourceUpdates, const QRegion &dirtyRegion, TextureFlags *flags) const { return m_proxy->toTexture(resourceUpdates, dirtyRegion, flags); } #endif #endif QImage DBackingStoreProxy::toImage() const { return m_proxy->toImage(); } QPlatformGraphicsBuffer *DBackingStoreProxy::graphicsBuffer() const { return m_proxy->graphicsBuffer(); } void DBackingStoreProxy::resize(const QSize &size, const QRegion &staticContents) { if (Q_LIKELY(enableGL)) { if (Q_LIKELY(glDevice)) { glDevice->resize(size); } else { glDevice.reset(new DOpenGLPaintDevice(window(), DOpenGLPaintDevice::PartialUpdateBlit)); } return; } m_proxy->resize(size, staticContents); if (!QHighDpiScaling::isActive()) { // 清理hidpi缓存 m_image = QImage(); return; } qreal scale = QHighDpiScaling::factor(window()); // 小数倍缩放时才开启此功能 if (qCeil(scale) != qFloor(scale)) { bool hasAlpha = toImage().pixelFormat().alphaUsage() == QPixelFormat::UsesAlpha; m_image = QImage(window()->size() * window()->devicePixelRatio(), hasAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); } } bool DBackingStoreProxy::scroll(const QRegion &area, int dx, int dy) { return m_proxy->scroll(area, dx, dy); } void DBackingStoreProxy::beginPaint(const QRegion ®ion) { if (glDevice) return; m_proxy->beginPaint(region); qreal window_scale = window()->devicePixelRatio(); bool enable = enableWallpaper && !m_wallpaper.isNull(); #ifndef DISABLE_WALLPAPER enable = enable && !DXcbWMSupport::instance()->hasWallpaperEffect(); #endif if (enable) { QPainter p(paintDevice()); for (QRect rect : region) { rect = QHighDpi::fromNativePixels(rect, window()); rect = QRect(rect.topLeft() * window_scale, QHighDpi::toNative(rect.size(), window_scale)); // 在指定区域绘制图片 p.drawImage(rect, m_wallpaper, rect); m_dirtyRect |= rect; } p.end(); } if (m_image.isNull()) { return; } m_dirtyRect = QRect(); QPainter p(&m_image); if (!enable) { p.setCompositionMode(QPainter::CompositionMode_Clear); for (QRect rect : region) { rect = QHighDpi::fromNativePixels(rect, window()); rect = QRect(rect.topLeft() * window_scale, QHighDpi::toNative(rect.size(), window_scale)); // 如果是透明绘制,应当先清理要绘制的区域 if (m_image.format() == QImage::Format_ARGB32_Premultiplied) p.fillRect(rect, Qt::transparent); m_dirtyRect |= rect; } } p.end(); if (m_dirtyRect.isValid()) { // 额外扩大一个像素,用于补贴两个不同尺寸图片上的绘图误差 m_dirtyRect.adjust(-window_scale, -window_scale, window_scale, window_scale); m_dirtyWindowRect = QRectF(m_dirtyRect.topLeft() / window_scale, m_dirtyRect.size() / window_scale); m_dirtyWindowRect = QHighDpi::toNativePixels(m_dirtyWindowRect, window()); } else { m_dirtyWindowRect = QRectF(); } } void DBackingStoreProxy::endPaint() { if (glDevice) return; QPainter pa(m_proxy->paintDevice()); pa.setRenderHints(QPainter::SmoothPixmapTransform); pa.setCompositionMode(QPainter::CompositionMode_Source); pa.drawImage(m_dirtyWindowRect, m_image, m_dirtyRect); pa.end(); m_proxy->endPaint(); } void DBackingStoreProxy::updateWallpaperShared() { QString key; #ifndef DISABLE_WALLPAPER key = Utility::windowProperty(window()->winId(), DXcbWMSupport::instance()->_deepin_wallpaper_shared_key, XCB_ATOM_STRING, 1024); #endif if (key.isEmpty()) return; if (m_sharedMemory != nullptr) { m_wallpaper = QImage(); delete m_sharedMemory; m_sharedMemory = nullptr; } m_sharedMemory = new QSharedMemory(key); if (!m_sharedMemory->attach()) { qWarning() << "Unable to attach to shared memory segment."; return; } m_sharedMemory->lock(); const qint32 *header = reinterpret_cast(m_sharedMemory->constData()); const uchar *content = reinterpret_cast(m_sharedMemory->constData()) + HEADER_SIZE; qint32 byte_count = header[0]; qint32 image_width = header[1]; qint32 image_height = header[2]; qint32 image_format = header[3]; m_wallpaper = QImage(content, image_width, image_height, QImage::Format(image_format)); m_sharedMemory->unlock(); window()->requestUpdate(); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dbackingstoreproxy.h000066400000000000000000000054441476226662200224500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DBACKINGSTOREPROXY_H #define DBACKINGSTOREPROXY_H #include "global.h" #include QT_BEGIN_NAMESPACE class QSharedMemory; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DOpenGLPaintDevice; class DBackingStoreProxy : public QPlatformBackingStore { public: static bool useGLPaint(const QWindow *w); static bool useWallpaperPaint(const QWindow *w); DBackingStoreProxy(QPlatformBackingStore *proxy, bool useGLPaint = false, bool useWallpaper = false); ~DBackingStoreProxy() override; QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context) override; #elif QT_VERSION < QT_VERSION_CHECK(5, 10, 0) void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #elif QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #else FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif #if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const override; #else QRhiTexture *toTexture(QRhiResourceUpdateBatch *resourceUpdates, const QRegion &dirtyRegion, TextureFlags *flags) const override; #endif #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; void endPaint() override; private: void updateWallpaperShared(); private: QPlatformBackingStore *m_proxy = nullptr; QImage m_image; QRectF m_dirtyWindowRect; QRect m_dirtyRect; QScopedPointer glDevice; bool enableGL = false; bool enableWallpaper = false; QSharedMemory *m_sharedMemory = nullptr; QImage m_wallpaper; }; DPP_END_NAMESPACE #endif // DBACKINGSTOREPROXY_H qt5platform-plugins-5.7.12/src/ddesktopinputselectioncontrol.cpp000066400000000000000000000566031476226662200252710ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "ddesktopinputselectioncontrol.h" #include "dinputselectionhandle.h" #include "dapplicationeventmonitor.h" #include "dselectedtexttooltip.h" #include #include #include #include #include #include #include #include #include #include #define EFFECTIVEWIDTH 10 #define STATUSBARHEIGHT 40 DPP_BEGIN_NAMESPACE DDesktopInputSelectionControl::DDesktopInputSelectionControl(QObject *parent, QInputMethod *inputMethod) : QObject(parent) , m_pInputMethod(inputMethod) , m_anchorSelectionHandle() , m_cursorSelectionHandle() , m_handleState(HandleIsReleased) , m_eventFilterEnabled(true) , m_anchorHandleVisible(false) , m_cursorHandleVisible(false) , m_handleVisible(false) , m_fingerOptSize(40, static_cast(40 * 1.12)) // because a finger patch is slightly taller than its width { if (auto window = QGuiApplication::focusWindow()) { window->installEventFilter(this); } connect(m_pInputMethod, &QInputMethod::anchorRectangleChanged, this, [ = ]{ QPointF point = anchorRectangle().topLeft(); QObject *widget = QGuiApplication::focusObject(); updateSelectionControlVisible(); if (point.isNull() || (m_focusWindow.value(widget) == point)) { return; } m_focusWindow[widget] = point; widget->installEventFilter(this); m_selectedTextTooltip->hide(); }); connect(qApp, &QGuiApplication::focusWindowChanged, this, &DDesktopInputSelectionControl::onFocusWindowChanged); } DDesktopInputSelectionControl::~DDesktopInputSelectionControl() { qDeleteAll(m_eventQueue); m_eventQueue.clear(); } /* * Includes the hit area surrounding the visual handle */ QRect DDesktopInputSelectionControl::handleRectForCursorRect(const QRectF &cursorRect) const { // TODO 平板下默认1.5倍缩放,缩放再度调整时(2 3期)细节可能有问题故使用此临时方案。 const int margin = static_cast(m_cursorSelectionHandle->devicePixelRatio()*2); const int topMargin = (m_fingerOptSize.height() - m_handleImageSize.height()) / 2; // 增加1px间隔 QPoint pos(int(cursorRect.x() + (cursorRect.width() - m_fingerOptSize.width()) / 2) + margin + 1, int(cursorRect.bottom()) - topMargin + margin); // 当从后往前选中时,为了防止光标被文字覆盖,这里把光标绘制在顶部 if (cursorRectangle().y() < anchorRectangle().y()) { pos.setY(int(cursorRect.top()) - topMargin - m_handleImageSize.height()); //由于顶部光标和底部的光标不同,这里更新一下handle类型 m_cursorSelectionHandle->setHandlePosition(DInputSelectionHandle::Up); } else { m_cursorSelectionHandle->setHandlePosition(DInputSelectionHandle::Down); } return QRect(pos, m_fingerOptSize); } QRect DDesktopInputSelectionControl::handleRectForAnchorRect(const QRectF &anchorRect) const { // TODO 平板下默认1.5倍缩放,缩放再度调整时(2 3期)细节可能有问题故使用此临时方案。 const int margin = static_cast(m_anchorSelectionHandle->devicePixelRatio()*2); const int topMargin = (m_fingerOptSize.height() - m_handleImageSize.height()) / 2; // 增加1px间隔 QPoint pos(int(anchorRect.x() + (anchorRect.width() - m_fingerOptSize.width()) / 2) + margin - 1, int(anchorRect.top()) - topMargin - m_handleImageSize.height()); // 当从后往前选中时,把anchor光标绘制底部,和cursor的处理保持一致 if (cursorRectangle().y() < anchorRectangle().y()) { pos.setY(int(anchorRect.bottom()) - topMargin); m_anchorSelectionHandle->setHandlePosition(DInputSelectionHandle::Down); } else { m_anchorSelectionHandle->setHandlePosition(DInputSelectionHandle::Up); } return QRect(pos, m_fingerOptSize); } bool DDesktopInputSelectionControl::testHandleVisible() const { return m_pApplicationEventMonitor->lastInputDeviceType() == DApplicationEventMonitor::TouchScreen; } /* * Includes the hit area surrounding the visual handle */ QRect DDesktopInputSelectionControl::anchorHandleRect() const { return handleRectForAnchorRect(anchorRectangle()); } /* * Includes the hit area surrounding the visual handle */ QRect DDesktopInputSelectionControl::cursorHandleRect() const { return handleRectForCursorRect(cursorRectangle()); } static int getInputRectangleY(const QPoint &pos) { // 保证handle不会超出TextEdit类输入框 int posY = pos.y(); QRect rect = QGuiApplication::inputMethod()->queryFocusObject(Qt::ImInputItemClipRectangle, true).toRect(); if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QPoint point = focusWindow->mapToGlobal(rect.topLeft()); rect.moveTo(point); if (pos.y() < rect.y()) { posY = rect.y(); } else if (pos.y() > rect.y() + rect.height()) { posY = rect.y() + rect.height(); } } return posY; } void DDesktopInputSelectionControl::updateAnchorHandlePosition() { if (anchorRectangle().topLeft().isNull()) { m_anchorSelectionHandle->hide(); return; } if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QPoint pos = focusWindow->mapToGlobal(anchorHandleRect().topLeft()); if (m_pInputMethod) { QRect rect = m_pInputMethod->queryFocusObject(Qt::ImInputItemClipRectangle, true).toRect(); QRect boardRect = m_pInputMethod->keyboardRectangle().toRect(); if (m_pInputMethod->isVisible() && (pos.y()+ anchorHandleRect().height() > m_pInputMethod->keyboardRectangle().y())) { pos.setY(pos.y() - (pos.y() - boardRect.y()) - rect.height()*2 - m_anchorSelectionHandle->height() / 4); } } // pos.setY(getInputRectangleY(pos)); m_anchorSelectionHandle->setPosition(pos); } } void DDesktopInputSelectionControl::updateCursorHandlePosition() { if (anchorRectangle().topLeft().isNull()) { m_cursorSelectionHandle->hide(); return; } if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QPoint pos = focusWindow->mapToGlobal(cursorHandleRect().topLeft()); if (m_pInputMethod) { QRect rect = m_pInputMethod->queryFocusObject(Qt::ImInputItemClipRectangle, true).toRect(); if (m_pInputMethod->isVisible() && (pos.y() + rect.height() > m_pInputMethod->keyboardRectangle().y())) { QRect boardRect = QGuiApplication::inputMethod()->keyboardRectangle().toRect(); pos.setY(pos.y() - (pos.y() - boardRect.y()) - rect.height() - m_cursorSelectionHandle->height() / 4 + EFFECTIVEWIDTH/2); } } // pos.setY(getInputRectangleY(pos)); m_cursorSelectionHandle->setPosition(pos); } } void DDesktopInputSelectionControl::updateTooltipPosition() { if (anchorRectangle().topLeft().isNull()) { m_selectedTextTooltip->hide(); return; } if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QPoint topleft_point; QSize tooltip_size = m_selectedTextTooltip->size(); if (cursorRectangle().x() >= anchorRectangle().x()) { // 从前往后选择 auto tmp_point = focusWindow->mapToGlobal(anchorHandleRect().topLeft()); topleft_point = QPoint(tmp_point.x() + m_fingerOptSize.width() / 2, tmp_point.y() - tooltip_size.height()); } else { //从后往前选择 auto tmp_point = focusWindow->mapToGlobal(anchorHandleRect().bottomLeft()); topleft_point = QPoint(tmp_point.x() - m_fingerOptSize.width() / 2 - tooltip_size.width(), tmp_point.y() + tooltip_size.height()); } if (topleft_point.x() < 0) { topleft_point.setX(m_fingerOptSize.width() / 2); } else { int windowW = QGuiApplication::primaryScreen()->availableGeometry().width(); int topX = topleft_point.x() + m_selectedTextTooltip->width(); topleft_point.setX(topX > windowW ? windowW - m_selectedTextTooltip->width() - EFFECTIVEWIDTH : topleft_point.x()); } // 因窗管增加了40px的标题栏高度, // 应用程序高度减少40px,屏幕不变 // 此处将40px处当作屏幕0 if (topleft_point.y() < STATUSBARHEIGHT) { auto margins = 0; if (m_anchorSelectionHandle->isVisible()) { auto anchorPosY = m_anchorSelectionHandle->position().y(); auto cursorPosY = m_cursorSelectionHandle->position().y(); margins = anchorPosY > cursorPosY ? anchorPosY : cursorPosY; } topleft_point.setY(margins + tooltip_size.height() + STATUSBARHEIGHT); } if (m_pInputMethod) { // 跟随虚拟键盘顶起改变位置 QRect rect = m_pInputMethod->inputItemClipRectangle().toRect(); if (m_pInputMethod->isVisible() && (topleft_point.y() + tooltip_size.height() > m_pInputMethod->keyboardRectangle().y())) { QRect boardRect = QGuiApplication::inputMethod()->keyboardRectangle().toRect(); topleft_point.setY(topleft_point.y() - (topleft_point.y() - boardRect.y()) - rect.height() - tooltip_size.height()*2); } } m_selectedTextTooltip->setPosition(topleft_point); } } void DDesktopInputSelectionControl::createHandles() { m_selectedTextTooltip.reset(new DSelectedTextTooltip); m_anchorSelectionHandle.reset(new DInputSelectionHandle(DInputSelectionHandle::Up, this)); m_cursorSelectionHandle.reset(new DInputSelectionHandle(DInputSelectionHandle::Down, this)); m_handleImageSize = m_anchorSelectionHandle->handleImageSize(); m_anchorSelectionHandle->resize(m_fingerOptSize); m_cursorSelectionHandle->resize(m_fingerOptSize); connect(m_selectedTextTooltip.data(), &DSelectedTextTooltip::optAction, this, &DDesktopInputSelectionControl::onOptAction); } void DDesktopInputSelectionControl::onWindowStateChanged(Qt::WindowState state) { m_focusWindow.clear(); m_anchorSelectionHandle->setVisible(state != Qt::WindowState::WindowMinimized); m_cursorSelectionHandle->setVisible(state != Qt::WindowState::WindowMinimized); m_selectedTextTooltip->setVisible(state != Qt::WindowState::WindowMinimized); } void DDesktopInputSelectionControl::updateSelectionControlVisible() { Q_ASSERT(m_pApplicationEventMonitor); bool selectText = m_pInputMethod->queryFocusObject(Qt::ImCurrentSelection,true).toString().isNull(); if (!selectText && m_handleVisible) { m_anchorSelectionHandle->show(); m_cursorSelectionHandle->show(); m_selectedTextTooltip->hide(); updateAnchorHandlePosition(); updateCursorHandlePosition(); } else { m_anchorSelectionHandle->hide(); m_cursorSelectionHandle->hide(); m_handleVisible = false; } updateHandleFlags(); } void DDesktopInputSelectionControl::onOptAction(int type) { switch (type) { case DSelectedTextTooltip::Cut: { QKeyEvent key_event(QEvent::KeyPress, Qt::Key_X, Qt::ControlModifier); QCoreApplication::sendEvent(QGuiApplication::focusObject(), &key_event); break; } case DSelectedTextTooltip::Copy: { QKeyEvent key_event(QEvent::KeyPress, Qt::Key_C, Qt::ControlModifier); QCoreApplication::sendEvent(QGuiApplication::focusObject(), &key_event); Q_EMIT selectionControlVisibleChanged(); break; } case DSelectedTextTooltip::Paste: { QKeyEvent key_event(QEvent::KeyPress, Qt::Key_V, Qt::ControlModifier); QCoreApplication::sendEvent(QGuiApplication::focusObject(), &key_event); break; } case DSelectedTextTooltip::SelectAll: { QKeyEvent key_event(QEvent::KeyPress, Qt::Key_A, Qt::ControlModifier); QCoreApplication::sendEvent(QGuiApplication::focusObject(), &key_event); // 更新handle的位置 m_handleVisible = true; updateSelectionControlVisible(); m_selectedTextTooltip->show(); break; } default: break; } } void DDesktopInputSelectionControl::onFocusWindowChanged() { if (!qApp->focusWindow()) { m_anchorSelectionHandle->hide(); m_cursorSelectionHandle->hide(); m_selectedTextTooltip->hide(); m_focusWindow.clear(); } } void DDesktopInputSelectionControl::setHandleState(HandleState state) { m_handleState = state; } int DDesktopInputSelectionControl::anchorPosition() const { QInputMethodQueryEvent imQueryEvent(Qt::InputMethodQueries(Qt::ImHints | Qt::ImQueryInput | Qt::ImInputItemClipRectangle)); const int anchorPosition = imQueryEvent.value(Qt::ImAnchorPosition).toInt(); return anchorPosition; } int DDesktopInputSelectionControl::cursorPosition() const { QInputMethodQueryEvent imQueryEvent(Qt::InputMethodQueries(Qt::ImHints | Qt::ImQueryInput | Qt::ImInputItemClipRectangle)); const int cursorPosition = imQueryEvent.value(Qt::ImCursorPosition).toInt(); return cursorPosition; } Qt::InputMethodHints DDesktopInputSelectionControl::inputMethodHints() const { QInputMethodQueryEvent imQueryEvent(Qt::InputMethodQueries(Qt::ImHints | Qt::ImQueryInput | Qt::ImInputItemClipRectangle)); Qt::InputMethodHints inputMethodHints = Qt::InputMethodHints(imQueryEvent.value(Qt::ImHints).toInt()); return inputMethodHints; } QRectF DDesktopInputSelectionControl::anchorRectangle() const { return m_pInputMethod->anchorRectangle(); } QRectF DDesktopInputSelectionControl::cursorRectangle() const { return m_pInputMethod->cursorRectangle(); } QRectF DDesktopInputSelectionControl::keyboardRectangle() const { return m_pInputMethod->keyboardRectangle(); } bool DDesktopInputSelectionControl::anchorRectIntersectsClipRect() const { QInputMethodQueryEvent imQueryEvent(Qt::InputMethodQueries(Qt::ImHints | Qt::ImQueryInput | Qt::ImInputItemClipRectangle)); QRectF inputItemClipRect = imQueryEvent.value(Qt::ImInputItemClipRectangle).toRectF(); QRectF anchorRect = imQueryEvent.value(Qt::ImAnchorRectangle).toRectF(); return inputItemClipRect.intersects(anchorRect); } bool DDesktopInputSelectionControl::cursorRectIntersectsClipRect() const { QInputMethodQueryEvent imQueryEvent(Qt::InputMethodQueries(Qt::ImHints | Qt::ImQueryInput | Qt::ImInputItemClipRectangle)); QRectF inputItemClipRect = imQueryEvent.value(Qt::ImInputItemClipRectangle).toRectF(); QRectF cursorRect = imQueryEvent.value(Qt::ImCursorRectangle).toRectF(); return inputItemClipRect.intersects(cursorRect); } void DDesktopInputSelectionControl::updateHandleFlags() { if (m_anchorHandleVisible && m_cursorHandleVisible) { m_anchorHandleVisible = m_anchorSelectionHandle->isVisible(); m_cursorHandleVisible = m_cursorSelectionHandle->isVisible(); } } void DDesktopInputSelectionControl::setSelectionOnFocusObject(const QPointF &anchorPos, const QPointF &cursorPos) { return QPlatformInputContext::setSelectionOnFocusObject(anchorPos, cursorPos); } void DDesktopInputSelectionControl::setApplicationEventMonitor(DApplicationEventMonitor *pMonitor) { m_pApplicationEventMonitor = pMonitor; } bool DDesktopInputSelectionControl::eventFilter(QObject *object, QEvent *event) { Q_UNUSED(object) QWindow *focusWindow = QGuiApplication::focusWindow(); if (!m_eventFilterEnabled || focusWindow != object) { switch (event->type()) { case QEvent::FocusOut: case QEvent::ContextMenu: case QEvent::MouseButtonDblClick: break; default: return false; } } if (QGuiApplication::inputMethod() && !QGuiApplication::inputMethod()->isVisible() && m_anchorSelectionHandle && m_anchorSelectionHandle && m_anchorSelectionHandle->isVisible() && m_cursorSelectionHandle->isVisible()) { updateAnchorHandlePosition(); updateCursorHandlePosition(); } if (QGuiApplication::inputMethod() && !QGuiApplication::inputMethod()->isVisible() && m_selectedTextTooltip && m_selectedTextTooltip->isVisible()) { updateTooltipPosition(); } if (!m_focusWindow.isEmpty()) { if (!m_anchorSelectionHandle || !m_cursorSelectionHandle || !m_selectedTextTooltip) { createHandles(); } } switch (event->type()) { case QEvent::FocusOut: { if (m_focusWindow.isEmpty()) break; updateSelectionControlVisible(); if (auto widget = m_focusWindow.key(m_focusWindow.first())) { m_focusWindow.clear(); widget->removeEventFilter(this); m_selectedTextTooltip->hide(); } break; } case QEvent::ContextMenu: { if (m_focusWindow.isEmpty()) break; m_selectedTextTooltip->show(); updateTooltipPosition(); return true; } case QEvent::TouchBegin: { QPointF point = anchorRectangle().topLeft(); if (point.isNull() || m_anchorHandleVisible || m_cursorHandleVisible) break; QTouchEvent *touchEvent = static_cast(event); QList tpList = touchEvent->touchPoints(); QTouchEvent::TouchPoint tp = tpList.first(); QPointF touchPos = tp.lastPos(); // 有效点击位置 QRectF effectiveRect = anchorRectangle(); effectiveRect.setWidth(effectiveRect.width() + EFFECTIVEWIDTH); effectiveRect.setX(effectiveRect.x() - EFFECTIVEWIDTH / 2); if (!effectiveRect.contains(touchPos.toPoint())) return false; QObject *focusWidget = QGuiApplication::focusObject(); if (m_focusWindow.key(point) == focusWidget) { if (m_anchorSelectionHandle && !m_anchorSelectionHandle->isVisible()) { if (m_selectedTextTooltip->isVisible()) { m_selectedTextTooltip->hide(); } else { updateTooltipPosition(); m_selectedTextTooltip->show(); } } } break; } case QEvent::MouseButtonDblClick: { m_handleVisible = false; updateSelectionControlVisible(); break; } case QEvent::MouseButtonPress: { if (anchorRectangle().topLeft().isNull()) break; QMouseEvent *me = static_cast(event); const QPoint mousePos = me->screenPos().toPoint(); // calculate distances from mouse pos to each handle, // then choose to interact with the nearest handle struct SelectionHandleInfo { qreal squaredDistance; QPoint delta; QRect rect; }; SelectionHandleInfo handles[2]; handles[AnchorHandle].rect = anchorHandleRect(); handles[CursorHandle].rect = cursorHandleRect(); for (int i = 0; i <= CursorHandle; ++i) { SelectionHandleInfo &h = handles[i]; QPoint curHandleCenter = focusWindow->mapToGlobal(h.rect.center()); // ### map to desktoppanel const QPoint delta = mousePos - curHandleCenter; h.delta = delta; h.squaredDistance = QPoint::dotProduct(delta, delta); } // (squared) distances calculated, pick the closest handle HandleType closestHandle = (handles[AnchorHandle].squaredDistance < handles[CursorHandle].squaredDistance ? AnchorHandle : CursorHandle); // Can not be replaced with me->windowPos(); because the event might be forwarded from the window of the handle const QPoint windowPos = focusWindow->mapFromGlobal(mousePos); if (handles[closestHandle].rect.contains(windowPos)) { m_currentDragHandle = closestHandle; auto currentHandle = closestHandle == CursorHandle ? m_cursorSelectionHandle.data() : m_anchorSelectionHandle.data(); if (currentHandle->handlePosition() == DInputSelectionHandle::Up) { m_distanceBetweenMouseAndCursor = handles[closestHandle].delta - QPoint(0, m_fingerOptSize.height() / 2 + 4); } else { m_distanceBetweenMouseAndCursor = handles[closestHandle].delta - QPoint(0, -m_fingerOptSize.height() / 2 - 4); } m_handleState = HandleIsHeld; m_handleDragStartedPosition = mousePos; const QRect otherRect = handles[1 - closestHandle].rect; if (currentHandle->handlePosition() == DInputSelectionHandle::Up) { m_otherSelectionPoint = QPoint(otherRect.x() + otherRect.width() / 2, otherRect.top() - 4); } else { m_otherSelectionPoint = QPoint(otherRect.x() + otherRect.width() / 2, otherRect.bottom() + 4); } QMouseEvent *mouseEvent = new QMouseEvent(me->type(), me->localPos(), me->windowPos(), me->screenPos(), me->button(), me->buttons(), me->modifiers(), me->source()); m_eventQueue.append(mouseEvent); return true; } break; } case QEvent::MouseMove: { if (anchorRectangle().topLeft().isNull()) break; m_handleVisible = true; QMouseEvent *me = static_cast(event); QPoint mousePos = me->screenPos().toPoint(); if (m_handleState == HandleIsHeld) { QPoint delta = m_handleDragStartedPosition - mousePos; const int startDragDistance = QGuiApplication::styleHints()->startDragDistance(); if (QPoint::dotProduct(delta, delta) > startDragDistance * startDragDistance) { m_handleState = HandleIsMoving; } } if (m_handleState == HandleIsMoving) { QPoint cursorPos = mousePos - m_distanceBetweenMouseAndCursor; cursorPos = focusWindow->mapFromGlobal(cursorPos); if (m_currentDragHandle == CursorHandle) { setSelectionOnFocusObject(m_otherSelectionPoint, cursorPos); } else { setSelectionOnFocusObject(cursorPos, m_otherSelectionPoint); } qDeleteAll(m_eventQueue); m_eventQueue.clear(); return true; } break; } case QEvent::MouseButtonRelease: { if (anchorRectangle().topLeft().isNull()) break; m_handleVisible = false; if (m_handleState == HandleIsMoving) { m_handleState = HandleIsReleased; qDeleteAll(m_eventQueue); m_eventQueue.clear(); return true; } else { if (QWindow *focusWindow = QGuiApplication::focusWindow()) { // playback event queue. These are events that were not designated // for the handles in hindsight. // This is typically MousePress and MouseRelease (not interleaved with MouseMove) // that should instead go through to the underlying input editor m_eventFilterEnabled = false; while (!m_eventQueue.isEmpty()) { QMouseEvent *e = m_eventQueue.takeFirst(); QCoreApplication::sendEvent(focusWindow, e); delete e; } m_eventFilterEnabled = true; } m_handleState = HandleIsReleased; } break; } default: break; } return false; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/ddesktopinputselectioncontrol.h000066400000000000000000000061321476226662200247260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DESKTOPINPUTSELECTIONCONTROL_H #define DESKTOPINPUTSELECTIONCONTROL_H #include "global.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class QMouseEvent; class QInputMethod; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DInputSelectionHandle; class DApplicationEventMonitor; class DSelectedTextTooltip; class DDesktopInputSelectionControl : public QObject { Q_OBJECT public: enum HandleState { HandleIsReleased = 0, HandleIsHeld = 1, HandleIsMoving = 2 }; enum HandleType { AnchorHandle = 0, CursorHandle = 1 }; DDesktopInputSelectionControl(QObject *parent, QInputMethod *inputMethod); ~DDesktopInputSelectionControl() override; void createHandles(); void setApplicationEventMonitor(DApplicationEventMonitor *pMonitor); public Q_SLOTS: void updateAnchorHandlePosition(); void updateCursorHandlePosition(); void updateTooltipPosition(); void onWindowStateChanged(Qt::WindowState state); void updateSelectionControlVisible(); void onOptAction(int type); void onFocusWindowChanged(); signals: void anchorPositionChanged(); void cursorPositionChanged(); void anchorRectangleChanged(); void cursorRectangleChanged(); void selectionControlVisibleChanged(); protected: bool eventFilter(QObject *object, QEvent *event) override; private: void setHandleState(HandleState state); int anchorPosition() const; int cursorPosition() const; Qt::InputMethodHints inputMethodHints() const; QRectF anchorRectangle() const; QRectF cursorRectangle() const; QRectF keyboardRectangle() const; bool anchorRectIntersectsClipRect() const; bool cursorRectIntersectsClipRect() const; void updateHandleFlags(); void setSelectionOnFocusObject(const QPointF &anchorPos, const QPointF &cursorPos); QRect anchorHandleRect() const; QRect cursorHandleRect() const; QRect handleRectForCursorRect(const QRectF &cursorRect) const; QRect handleRectForAnchorRect(const QRectF &anchorRect) const; bool testHandleVisible() const; private: QInputMethod *m_pInputMethod; QScopedPointer m_anchorSelectionHandle; QScopedPointer m_cursorSelectionHandle; QScopedPointer m_selectedTextTooltip; QPointer m_pApplicationEventMonitor; QSize m_handleImageSize; HandleState m_handleState; HandleType m_currentDragHandle; bool m_eventFilterEnabled; bool m_anchorHandleVisible; bool m_cursorHandleVisible; bool m_handleVisible; QPoint m_otherSelectionPoint; QVector m_eventQueue; QPoint m_distanceBetweenMouseAndCursor; QPoint m_handleDragStartedPosition; QSize m_fingerOptSize; QMap m_focusWindow; }; DPP_END_NAMESPACE #endif // DESKTOPINPUTSELECTIONCONTROL_H qt5platform-plugins-5.7.12/src/dinputselectionhandle.cpp000066400000000000000000000050671476226662200234500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dinputselectionhandle.h" #include "ddesktopinputselectioncontrol.h" #include #include #include #include #include DPP_BEGIN_NAMESPACE DInputSelectionHandle::DInputSelectionHandle(HandlePosition position, DDesktopInputSelectionControl *pControl) : QRasterWindow() , m_position(position) , m_pInputSelectionControl(pControl) { setFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus); QSurfaceFormat format; format.setAlphaBufferSize(8); setFormat(format); updateImage(position); } DInputSelectionHandle::HandlePosition DInputSelectionHandle::handlePosition() const { return m_position; } void DInputSelectionHandle::setHandlePosition(HandlePosition position) { if (m_position == position) { return; } m_position = position; updateImage(position); update(); } QSize DInputSelectionHandle::handleImageSize() const { return m_image.size() / devicePixelRatio(); } void DInputSelectionHandle::updateImage(HandlePosition position) { QImage handle; QImageReader reader(position == Up ? ":/up_handle.svg" : ":/down_handle.svg"); QSize image_size(reader.size()); reader.setScaledSize(image_size * devicePixelRatio()); reader.read(&handle); m_image = handle; m_image.setDevicePixelRatio(devicePixelRatio()); } void DInputSelectionHandle::paintEvent(QPaintEvent *pe) { Q_UNUSED(pe); QPainter painter(this); QImage image(m_image); const QSize szDelta = size() - image.size(); QPainter pa(&image); pa.setCompositionMode(QPainter::CompositionMode_SourceIn); pa.fillRect(image.rect(), qApp->palette().highlight()); // center image onto window painter.drawImage(QPointF(szDelta.width(), szDelta.height()) / 2, image); } void DInputSelectionHandle::mousePressEvent(QMouseEvent *event) { if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QCoreApplication::sendEvent(focusWindow, event); } } void DInputSelectionHandle::mouseReleaseEvent(QMouseEvent *event) { if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QCoreApplication::sendEvent(focusWindow, event); } } void DInputSelectionHandle::mouseMoveEvent(QMouseEvent *event) { if (QWindow *focusWindow = QGuiApplication::focusWindow()) { QCoreApplication::sendEvent(focusWindow, event); } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dinputselectionhandle.h000066400000000000000000000024051476226662200231060ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef INPUTSELECTIONHANDLE_H #define INPUTSELECTIONHANDLE_H #include "global.h" #include #include QT_BEGIN_NAMESPACE class QWindow; class QMouseEvent; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DDesktopInputSelectionControl; class DInputSelectionHandle : public QRasterWindow { Q_OBJECT public: enum HandlePosition { Up = 0, //handle位于选中区域的上方 Down = 1 // handle位于选中区域的下方 }; DInputSelectionHandle(HandlePosition position, DDesktopInputSelectionControl *pControl); HandlePosition handlePosition() const; void setHandlePosition(HandlePosition position); QSize handleImageSize() const; protected: void paintEvent(QPaintEvent *pe) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; private: void updateImage(HandlePosition position); private: HandlePosition m_position; DDesktopInputSelectionControl *m_pInputSelectionControl; QImage m_image; }; DPP_END_NAMESPACE #endif // INPUTSELECTIONHANDLE_H qt5platform-plugins-5.7.12/src/dnativesettings.cpp000066400000000000000000000374201476226662200222740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dnativesettings.h" #ifdef Q_OS_LINUX #include "dxcbxsettings.h" #endif #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if __has_include("dplatformintegration.h") #define __D_HAS_DPLATFORMINTEGRATION__ #endif #else #if QT_HAS_INCLUDE("dplatformintegration.h") #define __D_HAS_DPLATFORMINTEGRATION__ #endif #endif #ifdef __D_HAS_DPLATFORMINTEGRATION__ #include "dplatformintegration.h" #define IN_DXCB_PLUGIN #endif #include #include #include #define VALID_PROPERTIES "validProperties" #define ALL_KEYS "allKeys" DPP_BEGIN_NAMESPACE QHash DNativeSettings::mapped; /* * 通过覆盖QObject的qt_metacall虚函数,检测base object中自定义的属性列表,将xwindow对应的设置和object对象中的属性绑定到一起使用 * 将对象通过property/setProperty调用对属性的读写操作转为对xsetting的属性设 置 */ DNativeSettings::DNativeSettings(QObject *base, DPlatformSettings *settings, bool global_settings) : m_base(base) , m_settings(settings) , m_isGlobalSettings(global_settings) { if (mapped.value(base)) { qCritical() << "DNativeSettings: Native settings are already initialized for object:" << base; std::abort(); } mapped[base] = this; const QMetaObject *meta_object; if (qintptr ptr = qvariant_cast(m_base->property("_d_metaObject"))) { meta_object = reinterpret_cast(ptr); } else { meta_object = m_base->metaObject(); } if (m_settings->initialized()) { init(meta_object); } } DNativeSettings::~DNativeSettings() { if (!m_isGlobalSettings) { delete m_settings; } else if ( #ifdef IN_DXCB_PLUGIN DPlatformIntegration::instance() && #endif m_settings->initialized() ) { // 移除注册的callback m_settings->removeCallbackForHandle(this); m_settings->removeSignalCallback(this); } mapped.remove(m_base); if (m_metaObject) { free(m_metaObject); } } bool DNativeSettings::isValid() const { return m_settings->initialized(); } // TODO: This class needs to add a unit test void DNativeSettings::init(const QMetaObject *metaObject) { m_objectBuilder.addMetaObject(metaObject); m_firstProperty = metaObject->propertyOffset(); m_propertyCount = m_objectBuilder.propertyCount(); // 用于记录属性是否有效的属性, 属性类型为64位整数,最多可用于记录64个属性的状态 m_flagPropertyIndex = metaObject->indexOfProperty(VALID_PROPERTIES); qint64 validProperties = 0; // 用于记录所有属性的key m_allKeysPropertyIndex = metaObject->indexOfProperty(ALL_KEYS); int allKeyPropertyTyep = 0; QMetaObjectBuilder &ob = m_objectBuilder; #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) ob.setFlags(ob.flags() | DynamicMetaObject); #else ob.setFlags(ob.flags() | QMetaObjectBuilder::DynamicMetaObject); #endif // 先删除所有的属性,等待重构 while (ob.propertyCount() > 0) { ob.removeProperty(0); } QVector propertySignalIndex; propertySignalIndex.reserve(m_propertyCount); // QMetaObjectBuilder对象中的属性、信号、方法均从0开始,但是m_base对象的QMetaObject则包含offset // 因此往QMetaObjectBuilder对象中添加属性时要将其对应的信号的index减去偏移量 int signal_offset = metaObject->methodOffset(); for (int i = 0; i < m_propertyCount; ++i) { int index = i + m_firstProperty; const QMetaProperty &mp = metaObject->property(index); if (mp.hasNotifySignal()) { propertySignalIndex << mp.notifySignalIndex(); } // 跳过特殊属性 if (index == m_flagPropertyIndex) { ob.addProperty(mp); continue; } if (index == m_allKeysPropertyIndex) { ob.addProperty(mp); allKeyPropertyTyep = mp.userType(); continue; } if (m_settings->setting(mp.name()).isValid()) { validProperties |= (1 << i); } QMetaPropertyBuilder op; #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) switch (mp.typeId()) { #else switch (static_cast(mp.type())) { #endif case QMetaType::QByteArray: case QMetaType::QString: case QMetaType::QColor: case QMetaType::Int: case QMetaType::Double: case QMetaType::Bool: op = ob.addProperty(mp); break; default: // 重设属性的类型,只支持Int double color string bytearray op = ob.addProperty(mp.name(), "QByteArray", mp.notifySignalIndex() - signal_offset); break; } if (op.isWritable()) { // 声明支持属性reset op.setResettable(true); } } { // 通过class info确定是否应该关联对象的信号 int index = metaObject->indexOfClassInfo("SignalType"); if (index >= 0) { const QByteArray signals_value(metaObject->classInfo(index).value()); // 如果base对象声明为信号的生产者,则应该将其产生的信号转发到native settings if (signals_value == "producer") { // 创建一个槽用于接收所有信号 m_relaySlotIndex = ob.addMethod("relaySlot(QByteArray,qint32,qint32)").index() + metaObject->methodOffset(); } } } // 将属性状态设置给对象 m_base->setProperty(VALID_PROPERTIES, validProperties); // 将所有属性名称设置给对象 if (allKeyPropertyTyep == qMetaTypeId>()) { QSet set(m_settings->settingKeys().begin(), m_settings->settingKeys().end()); m_base->setProperty(ALL_KEYS, QVariant::fromValue(set)); } else { m_base->setProperty(ALL_KEYS, QVariant::fromValue(m_settings->settingKeys())); } m_propertySignalIndex = metaObject->indexOfMethod(QMetaObject::normalizedSignature("propertyChanged(const QByteArray&, const QVariant&)")); // 监听native setting变化 m_settings->registerCallback(reinterpret_cast(onPropertyChanged), this); // 监听信号. 如果base对象声明了要转发其信号,则此对象不应该关心来自于native settings的信号 // 即信号的生产者和消费者只能选其一 if (!isRelaySignal()) { m_settings->registerSignalCallback(reinterpret_cast(onSignal), this); } // 支持在base对象中直接使用property/setProperty读写native属性 QObjectPrivate *op = QObjectPrivate::get(m_base); op->metaObject = this; m_metaObject = ob.toMetaObject(); *static_cast(this) = *m_metaObject; if (isRelaySignal()) { // 把 static_metacall 置为nullptr,迫使对base对象调用QMetaObject::invodeMethod时使用DNativeSettings::metaCall d.static_metacall = nullptr; // 链接 base 对象的所有信号 int first_method = methodOffset(); int method_count = methodCount(); for (int i = 0; i < method_count; ++i) { int index = i + first_method; // 排除属性对应的信号 if (propertySignalIndex.contains(index)) { continue; } QMetaMethod method = this->method(index); if (method.methodType() != QMetaMethod::Signal) { continue; } QMetaObject::connect(m_base, index, m_base, m_relaySlotIndex, Qt::DirectConnection); } } } QByteArray DNativeSettings::getSettingsProperty(QObject *base) { const QMetaObject *meta_object; if (qintptr ptr = qvariant_cast(base->property("_d_metaObject"))) { meta_object = reinterpret_cast(ptr); } else { meta_object = base->metaObject(); } QByteArray settings_property; { // 获取base对象是否指定了native settings的域 // 默认情况下,native settings的值保存在窗口的_XSETTINGS_SETTINGS属性上 // 指定域后,会将native settings的值保存到指定的窗口属性。 // 将域的值转换成窗口属性时,会把 "/" 替换为 "_",如域:"/xxx/xxx" 转成窗口属性为:"_xxx_xxx" // 且所有字母转换为大写 settings_property = base->property("_d_domain").toByteArray(); if (settings_property.isEmpty()) { int index = meta_object->indexOfClassInfo("Domain"); if (index >= 0) { settings_property = QByteArray(meta_object->classInfo(index).value()); } } if (!settings_property.isEmpty()) { settings_property = settings_property.toUpper(); settings_property.replace('/', '_'); } } return settings_property; } int DNativeSettings::createProperty(const char *name, const char *) { // 不处理空字符串 if (strlen(name) == 0) { return -1; } // 不创建特殊属性(以'_'开头的属性认为是私有的,不自动关联到native Settings) if (QByteArrayLiteral(VALID_PROPERTIES) == name || QByteArrayLiteral(ALL_KEYS) == name || name[0] == '_') { return -1; } // 清理旧数据 free(m_metaObject); // 添加新属性 auto property = m_objectBuilder.addProperty(name, "QVariant"); property.setReadable(true); property.setWritable(true); property.setResettable(true); m_metaObject = m_objectBuilder.toMetaObject(); *static_cast(this) = *m_metaObject; return m_firstProperty + property.index(); } void DNativeSettings::onPropertyChanged(const QByteArray &name, const QVariant &property, DNativeSettings *handle) { if (handle->m_propertySignalIndex >= 0) { handle->method(handle->m_propertySignalIndex).invoke(handle->m_base, Q_ARG(QByteArray, name), Q_ARG(QVariant, property)); } // 重设对象的 ALL_KEYS 属性 { const QVariant &old_property = handle->m_base->property(ALL_KEYS); if (old_property.canConvert>()) { QSet keys = qvariant_cast>(old_property); int old_count = keys.count(); if (property.isValid()) { keys << name; } else if (keys.contains(name)) { keys.remove(name); } // 数量无变化时说明值无变化 if (old_count != keys.count()) { handle->m_base->setProperty(ALL_KEYS, QVariant::fromValue(keys)); } } else { bool changed = false; QByteArrayList keys = qvariant_cast(old_property); if (property.isValid()) { if (!keys.contains(name)) { keys << name; changed = true; } } else if (keys.contains(name)) { keys.removeOne(name); changed = true; } if (changed) { handle->m_base->setProperty(ALL_KEYS, QVariant::fromValue(keys)); } } } // 不要直接调用自己的indexOfProperty函数,属性不存在时会导致调用createProperty函数 int property_index = handle->m_objectBuilder.indexOfProperty(name.constData()); if (Q_UNLIKELY(property_index < 0)) { return; } { bool ok = false; qint64 flags = handle->m_base->property(VALID_PROPERTIES).toLongLong(&ok); // 更新有效属性的标志位 if (ok) { qint64 flag = (1 << property_index); flags = property.isValid() ? flags | flag : flags & ~flag; handle->m_base->setProperty(VALID_PROPERTIES, flags); } } const QMetaProperty &p = handle->property(handle->m_firstProperty + property_index); if (p.hasNotifySignal()) { // 通知属性改变 p.notifySignal().invoke(handle->m_base); } } // 处理native settings发过来的信号 void DNativeSettings::onSignal(const QByteArray &signal, qint32 data1, qint32 data2, DNativeSettings *handle) { // 根据不同的参数寻找对应的信号 static QByteArrayList signal_suffixs { QByteArrayLiteral("()"), QByteArrayLiteral("(qint32)"), QByteArrayLiteral("(qint32,qint32)") }; int signal_index = -1; for (const QByteArray &suffix : signal_suffixs) { signal_index = handle->indexOfMethod(signal + suffix); if (signal_index >= 0) break; } QMetaMethod signal_method = handle->method(signal_index); // 调用base对象对应的信号 signal_method.invoke(handle->m_base, Qt::DirectConnection, Q_ARG(qint32, data1), Q_ARG(qint32, data2)); } int DNativeSettings::metaCall(QMetaObject::Call _c, int _id, void ** _a) { enum CallFlag { ReadProperty = 1 << QMetaObject::ReadProperty, WriteProperty = 1 << QMetaObject::WriteProperty, ResetProperty = 1 << QMetaObject::ResetProperty, AllCall = ReadProperty | WriteProperty | ResetProperty }; if (AllCall & (1 << _c)) { const QMetaProperty &p = property(_id); const int index = p.propertyIndex(); // 对于本地属性,此处应该从m_settings中读写 if (Q_LIKELY(index != m_flagPropertyIndex && index != m_allKeysPropertyIndex && index >= m_firstProperty)) { switch (_c) { case QMetaObject::ReadProperty: *reinterpret_cast(_a[1]) = m_settings->setting(p.name()); _a[0] = reinterpret_cast(_a[1])->data(); break; case QMetaObject::WriteProperty: m_settings->setSetting(p.name(), *reinterpret_cast(_a[1])); break; case QMetaObject::ResetProperty: m_settings->setSetting(p.name(), QVariant()); break; default: break; } return -1; } } do { if (!isRelaySignal()) break; if (Q_LIKELY(_c != QMetaObject::InvokeMetaMethod || _id != m_relaySlotIndex)) { break; } int signal = m_base->senderSignalIndex(); QByteArray signal_name; qint32 data1 = 0, data2 = 0; // 不是通过信号触发的槽调用,可能是使用QMetaObject::invoke if (signal < 0) { signal_name = *reinterpret_cast(_a[1]); data1 = *reinterpret_cast(_a[2]); data2 = *reinterpret_cast(_a[3]); } else { const auto &signal_method = method(signal); signal_name = signal_method.name(); // 0为return type, 因此参数值下标从1开始 if (signal_method.parameterCount() > 0) { #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) QVariant arg(signal_method.parameterMetaType(0), _a[1]); #else QVariant arg(signal_method.parameterType(0), _a[1]); #endif // 获取参数1,获取参数2 data1 = arg.toInt(); } if (signal_method.parameterCount() > 1) { #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) QVariant arg(signal_method.parameterMetaType(1), _a[2]); #else QVariant arg(signal_method.parameterType(1), _a[2]); #endif data2 = arg.toInt(); } } m_settings->emitSignal(signal_name, data1, data2); return -1; } while (false); return m_base->qt_metacall(_c, _id, _a); } bool DNativeSettings::isRelaySignal() const { return m_relaySlotIndex > 0; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dnativesettings.h000066400000000000000000000034161476226662200217370ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DNATIVESETTINGS_H #define DNATIVESETTINGS_H #define protected public #include #undef protected #include "global.h" #include #include DPP_BEGIN_NAMESPACE class DPlatformSettings; class DNativeSettings : public QAbstractDynamicMetaObject { public: explicit DNativeSettings(QObject *base, DPlatformSettings *settings, bool global_settings); ~DNativeSettings(); static QByteArray getSettingsProperty(QObject *base); bool isValid() const; private: void init(const QMetaObject *meta_object); int createProperty(const char *, const char *) override; int metaCall(QMetaObject::Call, int _id, void **) override; bool isRelaySignal() const; static void onPropertyChanged(const QByteArray &name, const QVariant &property, DNativeSettings *handle); static void onSignal(const QByteArray &signal, qint32 data1, qint32 data2, DNativeSettings *handle); QObject *m_base; QMetaObject *m_metaObject = nullptr; QMetaObjectBuilder m_objectBuilder; int m_firstProperty; int m_propertyCount; // propertyChanged信号的index int m_propertySignalIndex; // VALID_PROPERTIES属性的index int m_flagPropertyIndex; // ALL_KEYS属性的index int m_allKeysPropertyIndex; // 用于转发base对象产生的信号的槽,使用native settings的接口将其发送出去. 值为0时表示不转发base对象的所有信号 int m_relaySlotIndex = 0; DPlatformSettings *m_settings = nullptr; bool m_isGlobalSettings = false; static QHash mapped; }; DPP_END_NAMESPACE #endif // DNATIVESETTINGS_H qt5platform-plugins-5.7.12/src/dopenglpaintdevice.cpp000066400000000000000000000334111476226662200227210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dopenglpaintdevice.h" #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); QT_END_NAMESPACE DPP_BEGIN_NAMESPACE // GLES2 builds won't have these constants with the suffixless names #ifndef GL_READ_FRAMEBUFFER #define GL_READ_FRAMEBUFFER 0x8CA8 #endif #ifndef GL_DRAW_FRAMEBUFFER #define GL_DRAW_FRAMEBUFFER 0x8CA9 #endif class DOpenGLPaintDevicePrivate : public QOpenGLPaintDevicePrivate { Q_DECLARE_PUBLIC(DOpenGLPaintDevice) public: DOpenGLPaintDevicePrivate(DOpenGLPaintDevice *qq, QSurface *surface, QOpenGLContext *shareContext, DOpenGLPaintDevice::UpdateBehavior updateBehavior) : QOpenGLPaintDevicePrivate(QSize()) , q_ptr(qq) , updateBehavior(updateBehavior) , hasFboBlit(false) , shareContext(shareContext) , targetSurface(surface) { if (!shareContext) this->shareContext = qt_gl_global_share_context(); } ~DOpenGLPaintDevicePrivate(); static DOpenGLPaintDevicePrivate *get(DOpenGLPaintDevice *w) { return w->d_func(); } void bindFBO(); void initialize(); void beginPaint() override; void endPaint() override; DOpenGLPaintDevice *q_ptr; DOpenGLPaintDevice::UpdateBehavior updateBehavior; bool hasFboBlit; QScopedPointer context; QOpenGLContext *shareContext; QScopedPointer fbo; QOpenGLTextureBlitter blitter; QColor backgroundColor; QSurface *targetSurface; bool builtinSurface; }; DOpenGLPaintDevicePrivate::~DOpenGLPaintDevicePrivate() { Q_Q(DOpenGLPaintDevice); if (q->isValid()) { q->makeCurrent(); // this works even when the platformwindow is destroyed fbo.reset(nullptr); blitter.destroy(); q->doneCurrent(); } if (builtinSurface && targetSurface) { delete targetSurface; } } void DOpenGLPaintDevicePrivate::initialize() { if (context) return; if (builtinSurface) { static_cast(targetSurface)->create(); } if (!targetSurface->surfaceHandle()) qWarning("Attempted to initialize DOpenGLPaintDevice without a platform surface"); context.reset(new QOpenGLContext); context->setShareContext(shareContext); context->setFormat(targetSurface->format()); if (!context->create()) qWarning("DOpenGLPaintDevice::beginPaint: Failed to create context"); if (!context->makeCurrent(targetSurface)) qWarning("DOpenGLPaintDevice::beginPaint: Failed to make context current"); if (updateBehavior == DOpenGLPaintDevice::PartialUpdateBlit) hasFboBlit = QOpenGLFramebufferObject::hasOpenGLFramebufferBlit(); ctx = context.data(); } static int defaultSamples(int fallback) { bool envIsIntValue = false; int global_samples = qEnvironmentVariableIntValue("D_GL_PAINT_SAMPLES", &envIsIntValue); return envIsIntValue ? global_samples : fallback; } void DOpenGLPaintDevicePrivate::beginPaint() { Q_Q(DOpenGLPaintDevice); initialize(); context->makeCurrent(targetSurface); const int deviceWidth = q->width() * q->devicePixelRatio(); const int deviceHeight = q->height() * q->devicePixelRatio(); const QSize deviceSize(deviceWidth, deviceHeight); if (updateBehavior > DOpenGLPaintDevice::NoPartialUpdate) { if (!fbo || fbo->size() != deviceSize) { QOpenGLFramebufferObjectFormat fboFormat; fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); int samples = targetSurface->format().samples(); // set the default samples if (samples < 0) { static int global_samples = defaultSamples(4); samples = global_samples; } if (updateBehavior != DOpenGLPaintDevice::PartialUpdateBlend) fboFormat.setSamples(samples); else qWarning("DOpenGLPaintDevice: PartialUpdateBlend does not support multisampling"); fbo.reset(new QOpenGLFramebufferObject(deviceSize, fboFormat)); } } context->functions()->glViewport(0, 0, deviceWidth, deviceHeight); context->functions()->glBindFramebuffer(GL_FRAMEBUFFER, context->defaultFramebufferObject()); if (updateBehavior > DOpenGLPaintDevice::NoPartialUpdate) fbo->bind(); } void DOpenGLPaintDevicePrivate::endPaint() { Q_Q(DOpenGLPaintDevice); if (updateBehavior > DOpenGLPaintDevice::NoPartialUpdate) fbo->release(); context->functions()->glBindFramebuffer(GL_FRAMEBUFFER, context->defaultFramebufferObject()); if (updateBehavior == DOpenGLPaintDevice::PartialUpdateBlit && hasFboBlit) { const int deviceWidth = q->width() * q->devicePixelRatio(); const int deviceHeight = q->height() * q->devicePixelRatio(); QOpenGLExtensions extensions(context.data()); extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->handle()); extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, context->defaultFramebufferObject()); extensions.glBlitFramebuffer(0, 0, deviceWidth, deviceHeight, 0, 0, deviceWidth, deviceHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); } else if (updateBehavior > DOpenGLPaintDevice::NoPartialUpdate) { if (updateBehavior == DOpenGLPaintDevice::PartialUpdateBlend) { context->functions()->glEnable(GL_BLEND); context->functions()->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } if (!blitter.isCreated()) blitter.create(); QRect windowRect(QPoint(0, 0), fbo->size()); QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(windowRect, windowRect); blitter.bind(); blitter.blit(fbo->texture(), target, QOpenGLTextureBlitter::OriginBottomLeft); blitter.release(); if (updateBehavior == DOpenGLPaintDevice::PartialUpdateBlend) context->functions()->glDisable(GL_BLEND); } } void DOpenGLPaintDevicePrivate::bindFBO() { if (updateBehavior > DOpenGLPaintDevice::NoPartialUpdate) fbo->bind(); else QOpenGLFramebufferObject::bindDefault(); } /*! Constructs a new DOpenGLPaintDevice with the given \a parent and \a updateBehavior. \sa DOpenGLPaintDevice::UpdateBehavior */ DOpenGLPaintDevice::DOpenGLPaintDevice(QSurface *surface, DOpenGLPaintDevice::UpdateBehavior updateBehavior) : QOpenGLPaintDevice(*new DOpenGLPaintDevicePrivate(this, surface, nullptr, updateBehavior)) { setSize(surface->size()); d_func()->builtinSurface = false; } DOpenGLPaintDevice::DOpenGLPaintDevice(const QSize &size, DOpenGLPaintDevice::UpdateBehavior updateBehavior) : QOpenGLPaintDevice(*new DOpenGLPaintDevicePrivate(this, new QOffscreenSurface(), nullptr, updateBehavior)) { setSize(size); d_func()->builtinSurface = true; } /*! Constructs a new DOpenGLPaintDevice with the given \a parent and \a updateBehavior. The DOpenGLPaintDevice's context will share with \a shareContext. \sa DOpenGLPaintDevice::UpdateBehavior shareContext */ DOpenGLPaintDevice::DOpenGLPaintDevice(QOpenGLContext *shareContext, QSurface *surface, UpdateBehavior updateBehavior) : QOpenGLPaintDevice(*new DOpenGLPaintDevicePrivate(this, surface, shareContext, updateBehavior)) { setSize(surface->size()); d_func()->builtinSurface = false; } DOpenGLPaintDevice::DOpenGLPaintDevice(QOpenGLContext *shareContext, const QSize &size, DOpenGLPaintDevice::UpdateBehavior updateBehavior) : QOpenGLPaintDevice(*new DOpenGLPaintDevicePrivate(this, new QOffscreenSurface(), shareContext, updateBehavior)) { setSize(size); d_func()->builtinSurface = true; } /*! Destroys the DOpenGLPaintDevice instance, freeing its resources. The OpenGLWindow's context is made current in the destructor, allowing for safe destruction of any child object that may need to release OpenGL resources belonging to the context provided by this window. \warning if you have objects wrapping OpenGL resources (such as QOpenGLBuffer, QOpenGLShaderProgram, etc.) as members of a DOpenGLPaintDevice subclass, you may need to add a call to makeCurrent() in that subclass' destructor as well. Due to the rules of C++ object destruction, those objects will be destroyed \e{before} calling this function (but after that the destructor of the subclass has run), therefore making the OpenGL context current in this function happens too late for their safe disposal. \sa makeCurrent \since 5.5 */ DOpenGLPaintDevice::~DOpenGLPaintDevice() { makeCurrent(); } void DOpenGLPaintDevice::resize(const QSize &size) { Q_ASSERT(!paintingActive()); setSize(size); Q_D(DOpenGLPaintDevice); if (d->fbo) d->fbo.reset(nullptr); } /*! \return the update behavior for this DOpenGLPaintDevice. */ DOpenGLPaintDevice::UpdateBehavior DOpenGLPaintDevice::updateBehavior() const { Q_D(const DOpenGLPaintDevice); return d->updateBehavior; } /*! \return \c true if the window's OpenGL resources, like the context, have been successfully initialized. Note that the return value is always \c false until the window becomes exposed (shown). */ bool DOpenGLPaintDevice::isValid() const { Q_D(const DOpenGLPaintDevice); return d->context && d->context->isValid(); } /*! Prepares for rendering OpenGL content for this window by making the corresponding context current and binding the framebuffer object, if there is one, in that context context. It is not necessary to call this function in most cases, because it is called automatically before invoking paintGL(). It is provided nonetheless to support advanced, multi-threaded scenarios where a thread different than the GUI or main thread may want to update the surface or framebuffer contents. See QOpenGLContext for more information on threading related issues. This function is suitable for calling also when the underlying platform window is already destroyed. This means that it is safe to call this function from a DOpenGLPaintDevice subclass' destructor. If there is no native window anymore, an offscreen surface is used instead. This ensures that OpenGL resource cleanup operations in the destructor will always work, as long as this function is called first. \sa QOpenGLContext, context(), paintGL(), doneCurrent() */ void DOpenGLPaintDevice::makeCurrent() { Q_D(DOpenGLPaintDevice); if (!isValid()) return; // The platform window may be destroyed at this stage and therefore // makeCurrent() may not safely be called with 'this'. d->context->makeCurrent(d->targetSurface); d->bindFBO(); } /*! Releases the context. It is not necessary to call this function in most cases, since the widget will make sure the context is bound and released properly when invoking paintGL(). \sa makeCurrent() */ void DOpenGLPaintDevice::doneCurrent() { Q_D(DOpenGLPaintDevice); if (!isValid()) return; d->context->doneCurrent(); } void DOpenGLPaintDevice::flush() { Q_D(DOpenGLPaintDevice); d->context->makeCurrent(d->targetSurface); d->context->swapBuffers(d->targetSurface); } /*! \return The QOpenGLContext used by this window or \c 0 if not yet initialized. */ QOpenGLContext *DOpenGLPaintDevice::context() const { Q_D(const DOpenGLPaintDevice); return d->context.data(); } /*! \return The QOpenGLContext requested to be shared with this window's QOpenGLContext. */ QOpenGLContext *DOpenGLPaintDevice::shareContext() const { Q_D(const DOpenGLPaintDevice); return d->shareContext; } /*! The framebuffer object handle used by this window. When the update behavior is set to \c NoPartialUpdate, there is no separate framebuffer object. In this case the returned value is the ID of the default framebuffer. Otherwise the value of the ID of the framebuffer object or \c 0 if not yet initialized. */ GLuint DOpenGLPaintDevice::defaultFramebufferObject() const { Q_D(const DOpenGLPaintDevice); if (d->updateBehavior > NoPartialUpdate && d->fbo) return d->fbo->handle(); else if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) return ctx->defaultFramebufferObject(); else return 0; } /*! Returns a copy of the framebuffer. \note This is a potentially expensive operation because it relies on glReadPixels() to read back the pixels. This may be slow and can stall the GPU pipeline. \note When used together with update behavior \c NoPartialUpdate, the returned image may not contain the desired content when called after the front and back buffers have been swapped (unless preserved swap is enabled in the underlying windowing system interface). In this mode the function reads from the back buffer and the contents of that may not match the content on the screen (the front buffer). In this case the only place where this function can safely be used is paintGL() or paintOverGL(). */ QImage DOpenGLPaintDevice::grabFramebuffer() { if (!isValid()) return QImage(); makeCurrent(); const bool hasAlpha = context()->format().hasAlpha(); QImage img = qt_gl_read_framebuffer(QSize(width(), height()) * devicePixelRatio(), hasAlpha, hasAlpha); img.setDevicePixelRatio(devicePixelRatio()); return img; } void DOpenGLPaintDevice::ensureActiveTarget() { Q_D(DOpenGLPaintDevice); d->initialize(); d->context->makeCurrent(d->targetSurface); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dopenglpaintdevice.h000066400000000000000000000030561476226662200223700ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DOPENGLPAINTDEVICE_H #define DOPENGLPAINTDEVICE_H #include "global.h" #include #include #include DPP_BEGIN_NAMESPACE class DOpenGLPaintDevicePrivate; class DOpenGLPaintDevice : public QOpenGLPaintDevice { Q_DECLARE_PRIVATE(DOpenGLPaintDevice) public: enum UpdateBehavior { NoPartialUpdate, PartialUpdateBlit, PartialUpdateBlend }; explicit DOpenGLPaintDevice(QSurface *surface, UpdateBehavior updateBehavior = PartialUpdateBlit); explicit DOpenGLPaintDevice(const QSize &size, UpdateBehavior updateBehavior = PartialUpdateBlit); explicit DOpenGLPaintDevice(QOpenGLContext *shareContext, QSurface *surface = nullptr, UpdateBehavior updateBehavior = PartialUpdateBlit); explicit DOpenGLPaintDevice(QOpenGLContext *shareContext, const QSize &size, UpdateBehavior updateBehavior = PartialUpdateBlit); ~DOpenGLPaintDevice(); void resize(const QSize &size); UpdateBehavior updateBehavior() const; bool isValid() const; void makeCurrent(); void doneCurrent(); void flush(); QOpenGLContext *context() const; QOpenGLContext *shareContext() const; GLuint defaultFramebufferObject() const; QImage grabFramebuffer(); private: using QOpenGLPaintDevice::setSize; void ensureActiveTarget() override; Q_DISABLE_COPY(DOpenGLPaintDevice) }; DPP_END_NAMESPACE #endif // DOPENGLPAINTDEVICE_H qt5platform-plugins-5.7.12/src/dplatformsettings.cpp000066400000000000000000000030361476226662200226260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dplatformsettings.h" DPP_BEGIN_NAMESPACE void DPlatformSettings::registerCallback(DPlatformSettings::PropertyChangeFunc func, void *handle) { Callback callback = { func, handle }; callback_links.push_back(callback); } void DPlatformSettings::removeCallbackForHandle(void *handle) { auto isCallbackForHandle = [handle](const Callback &cb) { return cb.handle == handle; }; callback_links.erase(std::remove_if(callback_links.begin(), callback_links.end(), isCallbackForHandle)); } void DPlatformSettings::registerSignalCallback(DPlatformSettings::SignalFunc func, void *handle) { SignalCallback callback = { func, handle }; signal_callback_links.push_back(callback); } void DPlatformSettings::removeSignalCallback(void *handle) { auto isCallbackForHandle = [handle](const SignalCallback &cb) { return cb.handle == handle; }; signal_callback_links.erase(std::remove_if(signal_callback_links.begin(), signal_callback_links.end(), isCallbackForHandle)); } void DPlatformSettings::handlePropertyChanged(const QByteArray &property, const QVariant &value) { for (auto callback : callback_links) { callback.func(property, value, callback.handle); } } void DPlatformSettings::handleNotify(const QByteArray &signal, qint32 data1, qint32 data2) { for (auto callback : signal_callback_links) { callback.func(signal, data1, data2, callback.handle); } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dplatformsettings.h000066400000000000000000000034001476226662200222660ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPLATFORMSETTINGS_H #define DPLATFORMSETTINGS_H #include "global.h" #include QT_BEGIN_NAMESPACE class QByteArray; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DPlatformSettings { public: virtual ~DPlatformSettings() {} virtual bool initialized() const { return true; } virtual bool isEmpty() const { return false; } virtual bool contains(const QByteArray &property) const = 0; virtual QVariant setting(const QByteArray &property) const = 0; virtual void setSetting(const QByteArray &property, const QVariant &value) = 0; virtual QByteArrayList settingKeys() const = 0; virtual void emitSignal(const QByteArray &signal, qint32 data1, qint32 data2) = 0; typedef void (*PropertyChangeFunc)(const QByteArray &name, const QVariant &property, void *handle); void registerCallback(PropertyChangeFunc func, void *handle); void removeCallbackForHandle(void *handle); typedef void (*SignalFunc)(const QByteArray &signal, qint32 data1, qint32 data2, void *handle); void registerSignalCallback(SignalFunc func, void *handle); void removeSignalCallback(void *handle); protected: void handlePropertyChanged(const QByteArray &property, const QVariant &value); void handleNotify(const QByteArray &signal, qint32 data1, qint32 data2); struct Q_DECL_HIDDEN Callback { PropertyChangeFunc func; void *handle; }; struct Q_DECL_HIDDEN SignalCallback { SignalFunc func; void *handle; }; std::vector callback_links; std::vector signal_callback_links; }; DPP_END_NAMESPACE #endif // DPLATFORMSETTINGS_H qt5platform-plugins-5.7.12/src/dselectedtexttooltip.cpp000066400000000000000000000077311476226662200233370ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dselectedtexttooltip.h" #include #include #include #include #include #include #include #define TEXT_SPACINGWIDGET 20 #define TEXT_SPACINGHEIGHT 10 #define WINDOWBOARD 1 DPP_BEGIN_NAMESPACE DSelectedTextTooltip::DSelectedTextTooltip() : QRasterWindow() , m_borderColor(0, 0, 0, 0.05 *255) { setFlags(Qt::ToolTip | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus); QSurfaceFormat format; format.setAlphaBufferSize(8); setFormat(format); // 这里借用QLineEdit的翻译 m_textInfoVec.push_back({SelectAll, 0, qApp->translate("QLineEdit", "Select All")}); m_textInfoVec.push_back({Cut, 0, qApp->translate("QLineEdit", "Cu&t").split("(").at(0)}); m_textInfoVec.push_back({Copy, 0, qApp->translate("QLineEdit", "&Copy").split("(").at(0)}); m_textInfoVec.push_back({Paste, 0, qApp->translate("QLineEdit", "&Paste").split("(").at(0)}); updateColor(); connect(qApp, &QGuiApplication::fontChanged, this, &DSelectedTextTooltip::onFontChanged); // 更新文本信息 onFontChanged(); } DSelectedTextTooltip::~DSelectedTextTooltip() { } void DSelectedTextTooltip::onFontChanged() { QFontMetrics font_metrics(qApp->font()); int tooltip_width = 0; for (auto &font_info : m_textInfoVec) { int tmp_width = font_metrics.horizontalAdvance(font_info.optName); font_info.textWidth = tmp_width + 2 * TEXT_SPACINGWIDGET; tooltip_width += font_info.textWidth; } m_textInfoVec.first().textWidth += WINDOWBOARD; m_textInfoVec.last().textWidth += WINDOWBOARD; resize(tooltip_width + 2*WINDOWBOARD, font_metrics.height() + 2 * TEXT_SPACINGHEIGHT + 2*WINDOWBOARD); } void DSelectedTextTooltip::updateColor() { // 参考DtkGui QColor rgb_color = qApp->palette().window().color().toRgb(); float luminance = 0.299 * rgb_color.redF() + 0.587 * rgb_color.greenF() + 0.114 * rgb_color.blueF(); if (qRound(luminance * 255) > 191) { m_backgroundColor = QColor("#fafafa"); m_dividerColor = QColor("#d6d6d6"); return; } m_backgroundColor = QColor("#434343"); m_dividerColor = QColor("#4f4f4f"); return; } DSelectedTextTooltip::OptionType DSelectedTextTooltip::getOptionType(const QPoint &pos) const { int tmp_width = 0; for (const auto &info : m_textInfoVec) { tmp_width += info.textWidth; if (pos.x() < tmp_width) { return info.optType; } } return None; } void DSelectedTextTooltip::mousePressEvent(QMouseEvent *event) { Q_EMIT optAction(getOptionType(event->pos())); } void DSelectedTextTooltip::paintEvent(QPaintEvent *pe) { updateColor(); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); painter.setBrush(m_backgroundColor); painter.setPen(Qt::NoPen); painter.drawRoundedRect(pe->rect().adjusted(1, 1, -1, -1), 8, 8); painter.setBrush(Qt::NoBrush); painter.setPen(m_borderColor); painter.drawRoundedRect(pe->rect(), 8, 8); painter.setFont(qApp->font()); painter.setPen(QPen(qApp->palette().brightText().color(), 1)); int pos_x = 0; for (int index = 0; index < m_textInfoVec.size(); ++index) { if (index == 0 || index == m_textInfoVec.count() -1) { pos_x += WINDOWBOARD; } QRect text_rect(pos_x, WINDOWBOARD, m_textInfoVec[index].textWidth, pe->rect().height() - WINDOWBOARD); pos_x += m_textInfoVec[index].textWidth; painter.drawText(text_rect, Qt::AlignCenter, m_textInfoVec[index].optName); if (index == m_textInfoVec.count() -1) break; painter.save(); painter.setPen(m_dividerColor); painter.drawLine(text_rect.topRight(), text_rect.bottomRight()); painter.restore(); } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dselectedtexttooltip.h000066400000000000000000000022171476226662200227760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DSELECTEDTEXTTOOLTIP_H #define DSELECTEDTEXTTOOLTIP_H #include "global.h" #include #include DPP_BEGIN_NAMESPACE class DSelectedTextTooltip : public QRasterWindow { Q_OBJECT public: enum OptionType { None = 0, Cut = 1, //剪切 Copy = 2, //复制 Paste = 3, //粘贴 SelectAll = 4 //全选 }; DSelectedTextTooltip(); ~DSelectedTextTooltip() override; protected: void paintEvent(QPaintEvent *pe) override; void mousePressEvent(QMouseEvent *event) override; private slots: void onFontChanged(); signals: void optAction(OptionType type); private: void updateColor(); OptionType getOptionType(const QPoint &pos) const; struct OptionTextInfo { OptionType optType; int textWidth; QString optName; }; QVector m_textInfoVec; QColor m_backgroundColor; QColor m_dividerColor; QColor m_borderColor; }; DPP_END_NAMESPACE #endif // DSELECTEDTEXTTOOLTIP_H qt5platform-plugins-5.7.12/src/dxcbxsettings.cpp000066400000000000000000000656701476226662200217620ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2016 The Qt Company Ltd. // SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later OR LGPL-3.0-only #include "dxcbxsettings.h" #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #if __has_include("dplatformintegration.h") #define __D_HAS_DPLATFORMINTEGRATION__ #endif #else #if QT_HAS_INCLUDE("dplatformintegration.h") #define __D_HAS_DPLATFORMINTEGRATION__ #endif #endif #ifdef __D_HAS_DPLATFORMINTEGRATION__ #include "dplatformintegration.h" #include "qxcbconnection.h" #define IN_DXCB_PLUGIN #endif #include #include #include #include #include #include #include #include static xcb_atom_t internAtom(xcb_connection_t *conn, const char *name) { if (!name || *name == 0) return XCB_NONE; xcb_intern_atom_cookie_t cookie = xcb_intern_atom(conn, false, strlen(name), name); xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, cookie, 0); if (!reply) return XCB_NONE; xcb_atom_t atom = reply->atom; free(reply); return atom; } static QByteArray atomName(xcb_connection_t *conn, xcb_atom_t atom) { xcb_get_atom_name_cookie_t cookie = xcb_get_atom_name(conn, atom); xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(conn, cookie, nullptr); if (!reply) return nullptr; return QByteArray(xcb_get_atom_name_name(reply), xcb_get_atom_name_name_length(reply)); } #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct Q_DECL_HIDDEN DStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #ifndef Q_XCB_REPLY #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #endif #ifndef Q_XCB_REPLY_UNCHECKED #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) #endif DPP_BEGIN_NAMESPACE /* Implementation of http://standards.freedesktop.org/xsettings-spec/xsettings-0.5.html */ enum XSettingsType { XSettingsTypeInteger = 0, XSettingsTypeString = 1, XSettingsTypeColor = 2 }; struct Q_DECL_HIDDEN DXcbXSettingsCallback { DXcbXSettings::PropertyChangeFunc func; void *handle; }; struct Q_DECL_HIDDEN DXcbXSettingsSignalCallback { DXcbXSettings::SignalFunc func; void *handle; }; class Q_DECL_HIDDEN DXcbXSettingsPropertyValue { public: DXcbXSettingsPropertyValue() : last_change_serial(-1) {} bool updateValue(xcb_connection_t *connection, const QByteArray &name, const QVariant &value, int last_change_serial) { if (last_change_serial <= this->last_change_serial) return false; this->value = value; this->last_change_serial = last_change_serial; for (const auto &callback : callback_links) callback.func(connection, name, value, callback.handle); return true; } void addCallback(DXcbXSettings::PropertyChangeFunc func, void *handle) { DXcbXSettingsCallback callback = { func, handle }; callback_links.push_back(callback); } QVariant value; int last_change_serial = -1; std::vector callback_links; }; class Q_DECL_HIDDEN DXcbConnectionGrabber { public: DXcbConnectionGrabber(xcb_connection_t *connection); ~DXcbConnectionGrabber(); void release(); private: xcb_connection_t *m_connection; }; DXcbConnectionGrabber::DXcbConnectionGrabber(xcb_connection_t *connection) :m_connection(connection) { xcb_grab_server(m_connection); } DXcbConnectionGrabber::~DXcbConnectionGrabber() { release(); } void DXcbConnectionGrabber::release() { if (m_connection) { xcb_ungrab_server(m_connection); // 必须保证xserver立即处理此请求, 因为xcb是异步请求的 // 当前线程中可能还存在其它的xcb connection,如果在 // xcb_ungrab_server调用之后,且server收到请求之前 // 其它的connection请求并wait了xcb,将会导致当前进程阻塞 // 此xcb_ungrab_server的调用就无法到达xserver,于是就形成了死锁。 xcb_flush(m_connection); m_connection = 0; } } class Q_DECL_HIDDEN DXcbXSettingsPrivate { public: DXcbXSettingsPrivate(xcb_connection_t *connection, const QByteArray &property, DXcbXSettings *qq) : connection(connection) , initialized(false) , q_ptr(qq) { if (property.isEmpty()) { x_settings_atom = internAtom(connection, "_XSETTINGS_SETTINGS"); } else { x_settings_atom = internAtom(connection, property); } if (!_xsettings_notify_atom) { _xsettings_notify_atom = internAtom(connection, "_XSETTINGS_SETTINGS_NOTIFY"); } if (!_xsettings_signal_atom) { _xsettings_signal_atom = internAtom(connection,"_XSETTINGS_SETTINGS_SIGNAL"); } // init xsettings owner if (!_xsettings_owner) { _xsettings_owner = DXcbXSettings::getOwner(connection, 0); if (_xsettings_owner) { const uint32_t event = XCB_CW_EVENT_MASK; const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE }; xcb_change_window_attributes(connection, _xsettings_owner, event, event_mask); } } } QByteArray getSettings() { DXcbConnectionGrabber connectionGrabber(connection); Q_UNUSED(connectionGrabber) int offset = 0; QByteArray settings; while (1) { xcb_get_property_cookie_t cookie = xcb_get_property(connection, false, x_settings_window, x_settings_atom, internAtom(connection, "_XSETTINGS_SETTINGS"), offset/4, 8192); xcb_generic_error_t *error = nullptr; auto reply = xcb_get_property_reply(connection, cookie, &error); enum ErrorCode { BadWindow = 3 }; // 在窗口无效时,应当认为此native settings未初始化完成 if (error && error->error_code == ErrorCode::BadWindow) { initialized = false; return settings; } bool more = false; if (!reply) return settings; const auto property_value_length = xcb_get_property_value_length(reply); settings.append(static_cast(xcb_get_property_value(reply)), property_value_length); offset += property_value_length; more = reply->bytes_after != 0; free(reply); if (!more) break; } return settings; } void setSettings(const QByteArray &data) { DXcbConnectionGrabber connectionGrabber(connection); Q_UNUSED(connectionGrabber) xcb_change_property(connection, XCB_PROP_MODE_REPLACE, x_settings_window, x_settings_atom, internAtom(connection, "_XSETTINGS_SETTINGS"), 8, data.size(), data.constData()); xcb_window_t xsettings_owner = _xsettings_owner; // xsettings owner窗口,按照标准,其属性变化的事件就表示了通知 if (x_settings_window == xsettings_owner) return; // 对于非标准的窗口的xsettings,其窗口属性变化不是任何程序中都能默认收到,因此应该使用client message通知属性变化 // 且窗口的属性改变事件可能会被其它事件过滤器接收并处理(eg: KWin) // 因此改用client message通知窗口级别的xsettings属性变化 // 此client message事件发送给xsettings owner,且在事件数据 // 中携带属性变化窗口的window id。 if (xsettings_owner) { xcb_client_message_event_t notify_event; memset(¬ify_event, 0, sizeof(notify_event)); notify_event.response_type = XCB_CLIENT_MESSAGE; notify_event.format = 32; notify_event.sequence = 0; notify_event.window = xsettings_owner; notify_event.type = _xsettings_notify_atom; notify_event.data.data32[0] = x_settings_window; notify_event.data.data32[1] = x_settings_atom; xcb_send_event(connection, false, xsettings_owner, XCB_EVENT_MASK_PROPERTY_CHANGE, (const char *)¬ify_event); } } static int round_to_nearest_multiple_of_4(int value) { int remainder = value % 4; if (!remainder) return value; return value + 4 - remainder; } void populateSettings(const QByteArray &xSettings) { if (xSettings.length() < 12) return; char byteOrder = xSettings.at(0); if (byteOrder != XCB_IMAGE_ORDER_LSB_FIRST && byteOrder != XCB_IMAGE_ORDER_MSB_FIRST) { qWarning("ByteOrder byte %d not 0 or 1", byteOrder); return; } #define ADJUST_BO(b, t, x) \ ((b == XCB_IMAGE_ORDER_LSB_FIRST) ? \ qFromLittleEndian(x) : \ qFromBigEndian(x)) #define VALIDATE_LENGTH(x) \ if ((size_t)xSettings.length() < (offset + local_offset + 12 + x)) { \ qWarning("Length %d runs past end of data", x); \ return; \ } serial = ADJUST_BO(byteOrder, qint32, xSettings.mid(4,4).constData()); uint number_of_settings = ADJUST_BO(byteOrder, quint32, xSettings.mid(8,4).constData()); const char *data = xSettings.constData() + 12; size_t offset = 0; // 记录所有设置项的名称 QSet keys; keys.reserve(number_of_settings); for (uint i = 0; i < number_of_settings; i++) { int local_offset = 0; VALIDATE_LENGTH(2); XSettingsType type = static_cast(*reinterpret_cast(data + offset)); local_offset += 2; VALIDATE_LENGTH(2); quint16 name_len = ADJUST_BO(byteOrder, quint16, data + offset + local_offset); local_offset += 2; VALIDATE_LENGTH(name_len); QByteArray name(data + offset + local_offset, name_len); local_offset += round_to_nearest_multiple_of_4(name_len); VALIDATE_LENGTH(4); int last_change_serial = ADJUST_BO(byteOrder, qint32, data + offset + local_offset); Q_UNUSED(last_change_serial); local_offset += 4; QVariant value; if (type == XSettingsTypeString) { VALIDATE_LENGTH(4); int value_length = ADJUST_BO(byteOrder, qint32, data + offset + local_offset); local_offset+=4; VALIDATE_LENGTH(value_length); QByteArray value_string(data + offset + local_offset, value_length); value.setValue(value_string); local_offset += round_to_nearest_multiple_of_4(value_length); } else if (type == XSettingsTypeInteger) { VALIDATE_LENGTH(4); int value_length = ADJUST_BO(byteOrder, qint32, data + offset + local_offset); local_offset += 4; value.setValue(value_length); } else if (type == XSettingsTypeColor) { VALIDATE_LENGTH(2*4); quint16 red = ADJUST_BO(byteOrder, quint16, data + offset + local_offset); local_offset += 2; quint16 green = ADJUST_BO(byteOrder, quint16, data + offset + local_offset); local_offset += 2; quint16 blue = ADJUST_BO(byteOrder, quint16, data + offset + local_offset); local_offset += 2; quint16 alpha= ADJUST_BO(byteOrder, quint16, data + offset + local_offset); local_offset += 2; QColor color_value(red,green,blue,alpha); value.setValue(color_value); } offset += local_offset; updateValue(settings[name], name,value,last_change_serial); keys << name; } for (const QByteArray &key : settings.keys()) { if (!keys.contains(key)) { // 通知属性已经无效 updateValue(settings[key], key, QVariant(), INT_MAX); // 移除已经被删除的属性 settings.remove(key); } } } QByteArray depopulateSettings() { QByteArray xSettings; uint number_of_settings = settings.size(); xSettings.reserve(12 + number_of_settings * 12); char byteOrder = QSysInfo::ByteOrder == QSysInfo::LittleEndian ? XCB_IMAGE_ORDER_LSB_FIRST : XCB_IMAGE_ORDER_MSB_FIRST; xSettings.append(byteOrder); //byte-order xSettings.append(3, '\0'); //unused xSettings.append((char*)&serial, sizeof(serial)); //SERIAL xSettings.append((char*)&number_of_settings, sizeof(number_of_settings)); //N_SETTINGS uint number_of_settings_index = xSettings.size() - sizeof(number_of_settings); for (auto i = settings.constBegin(); i != settings.constEnd(); ++i) { const DXcbXSettingsPropertyValue &value = i.value(); // 忽略无效的数据 if (!value.value.isValid()) { --number_of_settings; continue; } char type = XSettingsTypeString; const QByteArray &key = i.key(); quint16 key_size = key.size(); switch (value.value.type()) { case QMetaType::QColor: type = XSettingsTypeColor; break; case QMetaType::Int: case QMetaType::Bool: type = XSettingsTypeInteger; break; default: break; } xSettings.append(type); //type xSettings.append('\0'); //unused xSettings.append((char*)&key_size, 2); //name-len xSettings.append(key.constData()); //name xSettings.append(3 - (key_size + 3) % 4, '\0'); //4字节对齐 xSettings.append((char*)&value.last_change_serial, 4); //last-change-serial QByteArray value_data; if (type == XSettingsTypeInteger) { qint32 int_value = value.value.toInt(); value_data.append((char*)&int_value, 4); } else if (type == XSettingsTypeColor) { const QColor &color = qvariant_cast(value.value); quint16 red = color.red(); quint16 green = color.green(); quint16 blue = color.blue(); quint16 alpha = color.alpha(); value_data.append((char*)&red, 2); value_data.append((char*)&green, 2); value_data.append((char*)&blue, 2); value_data.append((char*)&alpha, 2); } else { const QByteArray &string_data = value.value.toByteArray(); quint32 data_size = string_data.size(); value_data.append((char*)&data_size, 4); value_data.append(string_data); value_data.append(3 - (string_data.size() + 3) % 4, '\0'); //4字节对齐 } xSettings.append(value_data); } if (number_of_settings == 0) { return QByteArray(); } memcpy(xSettings.data() + number_of_settings_index, &number_of_settings, sizeof(number_of_settings)); return xSettings; } void init(xcb_window_t setting_window, DXcbXSettings *object) { x_settings_window = setting_window; mapped.insert(x_settings_window, object); initialized = true; populateSettings(getSettings()); } bool updateValue(DXcbXSettingsPropertyValue &xvalue, const QByteArray &name, const QVariant &value, int last_change_serial) { if (xvalue.updateValue(connection, name, value, last_change_serial)) { for (const auto &callback : callback_links) { callback.func(connection, name, value, callback.handle); } q_ptr->handlePropertyChanged(name, value); return true; } return false; } DXcbXSettings *q_ptr = nullptr; xcb_connection_t *connection; xcb_window_t x_settings_window; // 保存xsetting值的窗口属性 xcb_atom_t x_settings_atom; qint32 serial = -1; QHash settings; std::vector callback_links; std::vector signal_callback_links; bool initialized; static xcb_window_t _xsettings_owner; // 用于通知窗口native设置项发生改变 static xcb_atom_t _xsettings_notify_atom; // 用于实现信号通知 static xcb_atom_t _xsettings_signal_atom; static QMultiHash mapped; }; xcb_atom_t DXcbXSettingsPrivate::_xsettings_notify_atom = 0; xcb_atom_t DXcbXSettingsPrivate::_xsettings_signal_atom = 0; xcb_window_t DXcbXSettingsPrivate::_xsettings_owner = 0; QMultiHash DXcbXSettingsPrivate::mapped; DXcbXSettings::DXcbXSettings(xcb_connection_t *connection, const QByteArray &property) : DXcbXSettings(connection, 0, property) { } DXcbXSettings::DXcbXSettings(xcb_connection_t *connection, xcb_window_t setting_window, const QByteArray &property) : d_ptr(new DXcbXSettingsPrivate(connection, property, this)) { if (!setting_window) { setting_window = d_ptr->_xsettings_owner; } d_ptr->init(setting_window, this); } DXcbXSettings::DXcbXSettings(xcb_window_t setting_window, const QByteArray &property) : DXcbXSettings(nullptr, setting_window, property) { } DXcbXSettings::~DXcbXSettings() { DXcbXSettingsPrivate::mapped.remove(d_ptr->x_settings_window, this); delete d_ptr; d_ptr = 0; } xcb_window_t DXcbXSettings::getOwner(xcb_connection_t *conn, int screenNumber) { struct XcbConnectionDeleter { static inline void cleanup(xcb_connection_t *conn) { xcb_disconnect(conn); } }; QScopedPointer tmp_conn; if (!conn) { conn = xcb_connect(qgetenv("DISPLAY"), &screenNumber); if (!conn) return XCB_NONE; tmp_conn.reset(conn); } QByteArray settings_atom_for_screen("_XSETTINGS_S"); settings_atom_for_screen.append(QByteArray::number(screenNumber)); auto atom_reply = Q_XCB_REPLY(xcb_intern_atom, conn, true, settings_atom_for_screen.length(), settings_atom_for_screen.constData()); if (!atom_reply) return XCB_NONE; xcb_atom_t selection_owner_atom = atom_reply->atom; auto selection_result = Q_XCB_REPLY(xcb_get_selection_owner, conn, selection_owner_atom); if (!selection_result) return XCB_NONE; return selection_result->owner; } bool DXcbXSettings::initialized() const { Q_D(const DXcbXSettings); return d->initialized; } bool DXcbXSettings::isEmpty() const { Q_D(const DXcbXSettings); return d->settings.isEmpty(); } bool DXcbXSettings::contains(const QByteArray &property) const { Q_D(const DXcbXSettings); return d->settings.contains(property); } bool DXcbXSettings::handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) { // 其它窗口的xsettings属性变化是通过client message通知的 if (event->window != DXcbXSettingsPrivate::_xsettings_owner) { return false; } auto self_list = DXcbXSettingsPrivate::mapped.values(event->window); if (self_list.isEmpty()) return false; for (DXcbXSettings *self : self_list) { // 另外需要判断此对象的设置是监听的哪个窗口属性 if (event->atom == self->d_ptr->x_settings_atom) self->d_ptr->populateSettings(self->d_ptr->getSettings()); } return true; } bool DXcbXSettings::handleClientMessageEvent(const xcb_client_message_event_t *event) { if (event->format != 32) return false; if (event->type == DXcbXSettingsPrivate::_xsettings_notify_atom) { // data32[0]为属性变化的窗口 auto self_list = DXcbXSettingsPrivate::mapped.values(event->data.data32[0]); if (self_list.isEmpty()) return false; for (DXcbXSettings *self : self_list) { // data32[1]为变化的属性类型 if (self->d_ptr->x_settings_atom == event->data.data32[1]) self->d_ptr->populateSettings(self->d_ptr->getSettings()); } return true; } else if ( event->type == DXcbXSettingsPrivate::_xsettings_signal_atom) { // data32[0]为属性变化的窗口 xcb_window_t window = event->data.data32[0]; auto self_list = window ? DXcbXSettingsPrivate::mapped.values(window) : DXcbXSettingsPrivate::mapped.values(); if (self_list.isEmpty()) return false; // data32[1]记录信号属于窗口的哪个属性, 为0表示任意属性 xcb_atom_t type = event->data.data32[1]; for (DXcbXSettings *self : self_list) { if (type && type != self->d_ptr->x_settings_atom) continue; // data32[2]为signal id xcb_atom_t signal = event->data.data32[2]; #ifdef IN_DXCB_PLUGIN const QByteArray signal_string(DPlatformIntegration::xcbConnection()->atomName(signal)); #else const QByteArray signal_string(atomName(self->d_ptr->connection, signal)); #endif for (DXcbXSettingsSignalCallback cb : self->d_ptr->signal_callback_links) { cb.func(self->d_ptr->connection, signal_string, event->data.data32[3], event->data.data32[4], cb.handle); } self->handleNotify(signal_string, event->data.data32[3], event->data.data32[4]); } return true; } return false; } void DXcbXSettings::clearSettings(xcb_window_t setting_window) { if (DXcbXSettings *self = DXcbXSettingsPrivate::mapped.value(setting_window)) { xcb_delete_property(self->d_ptr->connection, setting_window, self->d_ptr->x_settings_atom); } } void DXcbXSettings::registerCallbackForProperty(const QByteArray &property, DXcbXSettings::PropertyChangeFunc func, void *handle) { Q_D(DXcbXSettings); d->settings[property].addCallback(func,handle); } void DXcbXSettings::removeCallbackForHandle(const QByteArray &property, void *handle) { Q_D(DXcbXSettings); auto &callbacks = d->settings[property].callback_links; auto isCallbackForHandle = [handle](const DXcbXSettingsCallback &cb) { return cb.handle == handle; }; callbacks.erase(std::remove_if(callbacks.begin(), callbacks.end(), isCallbackForHandle), callbacks.end()); } void DXcbXSettings::removeCallbackForHandle(void *handle) { Q_D(DXcbXSettings); for (QHash::const_iterator it = d->settings.cbegin(); it != d->settings.cend(); ++it) { removeCallbackForHandle(it.key(),handle); } auto isCallbackForHandle = [handle](const DXcbXSettingsCallback &cb) { return cb.handle == handle; }; d->callback_links.erase(std::remove_if(d->callback_links.begin(), d->callback_links.end(), isCallbackForHandle)); } void DXcbXSettings::registerSignalCallback(DXcbXSettings::SignalFunc func, void *handle) { Q_D(DXcbXSettings); DXcbXSettingsSignalCallback callback = { func, handle }; d->signal_callback_links.push_back(callback); } void DXcbXSettings::removeSignalCallback(void *handle) { Q_D(DXcbXSettings); auto isCallbackForHandle = [handle](const DXcbXSettingsSignalCallback &cb) { return cb.handle == handle; }; d->signal_callback_links.erase(std::remove_if(d->signal_callback_links.begin(), d->signal_callback_links.end(), isCallbackForHandle)); } void DXcbXSettings::emitSignal(const QByteArray &signal, qint32 data1, qint32 data2) { Q_D(const DXcbXSettings); emitSignal(d->connection, d->x_settings_window, d->x_settings_atom, signal, data1, data2); } void DXcbXSettings::emitSignal(xcb_connection_t *conn, xcb_window_t window, xcb_atom_t property, const QByteArray &signal, qint32 data1, qint32 data2) { xcb_window_t xsettings_owner = DXcbXSettingsPrivate::_xsettings_owner; if (!xsettings_owner) { return; } xcb_atom_t signal_atom = internAtom(conn, signal.constData()); // 使用client message事件模拟信号 xcb_client_message_event_t notify_event; notify_event.response_type = XCB_CLIENT_MESSAGE; notify_event.format = 32; notify_event.sequence = 0; notify_event.window = xsettings_owner; // 标记为信号通知 notify_event.type = DXcbXSettingsPrivate::_xsettings_signal_atom; // 信号附属的窗口 notify_event.data.data32[0] = window; // 信号附属窗口的属性 notify_event.data.data32[1] = property; // 信号id notify_event.data.data32[2] = signal_atom; // 信号携带的数据 notify_event.data.data32[3] = data1; // 信号携带的数据 notify_event.data.data32[4] = data2; xcb_send_event(conn, false, xsettings_owner, XCB_EVENT_MASK_PROPERTY_CHANGE, (const char *)¬ify_event); } QVariant DXcbXSettings::setting(const QByteArray &property) const { Q_D(const DXcbXSettings); return d->settings.value(property).value; } void DXcbXSettings::setSetting(const QByteArray &property, const QVariant &value) { Q_D(DXcbXSettings); DXcbXSettingsPropertyValue &xvalue = d->settings[property]; if (xvalue.value == value) return; d->updateValue(xvalue, property, value, xvalue.last_change_serial + 1); // 移除无效的属性 if (!value.isValid()) { d->settings.remove(property); } ++d->serial; // 更新属性 d->setSettings(d->depopulateSettings()); } QByteArrayList DXcbXSettings::settingKeys() const { Q_D(const DXcbXSettings); return d->settings.keys(); } void DXcbXSettings::registerCallback(DXcbXSettings::PropertyChangeFunc func, void *handle) { Q_D(DXcbXSettings); DXcbXSettingsCallback callback = { func, handle }; d->callback_links.push_back(callback); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/dxcbxsettings.h000066400000000000000000000050071476226662200214130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2016 The Qt Company Ltd. // SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later OR LGPL-3.0-only #ifndef DXCBXSETTINGS_H #define DXCBXSETTINGS_H #include "dplatformsettings.h" #include #include #include QT_BEGIN_NAMESPACE class QVariant; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DXcbXSettingsPrivate; class DXcbXSettings : public DPlatformSettings { Q_DECLARE_PRIVATE(DXcbXSettings) public: DXcbXSettings(xcb_connection_t *connection, const QByteArray &property = QByteArray()); DXcbXSettings(xcb_connection_t *connection, xcb_window_t setting_window, const QByteArray &property = QByteArray()); DXcbXSettings(xcb_window_t setting_window, const QByteArray &property = QByteArray()); ~DXcbXSettings(); static xcb_window_t getOwner(xcb_connection_t *conn = nullptr, int screenNumber = 0); bool initialized() const override; bool isEmpty() const override; bool contains(const QByteArray &property) const override; QVariant setting(const QByteArray &property) const override; void setSetting(const QByteArray &property, const QVariant &value) override; QByteArrayList settingKeys() const override; typedef void (*PropertyChangeFunc)(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle); void registerCallback(PropertyChangeFunc func, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); typedef void (*SignalFunc)(xcb_connection_t *connection, const QByteArray &signal, qint32 data1, qint32 data2, void *handle); void registerSignalCallback(SignalFunc func, void *handle); void removeSignalCallback(void *handle); void emitSignal(const QByteArray &signal, qint32 data1, qint32 data2) override; static void emitSignal(xcb_connection_t *conn, xcb_window_t window, xcb_atom_t type, const QByteArray &signal, qint32 data1, qint32 data2); static bool handlePropertyNotifyEvent(const xcb_property_notify_event_t *event); static bool handleClientMessageEvent(const xcb_client_message_event_t *event); static void clearSettings(xcb_window_t setting_window); private: DXcbXSettingsPrivate *d_ptr; friend class DXcbXSettingsPrivate; }; DPP_END_NAMESPACE #endif // DXCBXSETTINGS_H qt5platform-plugins-5.7.12/src/global.cpp000066400000000000000000000014421476226662200203140ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "global.h" #include #include QWindow * fromQtWinId(WId id) { QWindow *window = nullptr; for (auto win : qApp->allWindows()) { if (win->winId() == id) { window = win; break; } } return window; }; DPP_BEGIN_NAMESPACE RunInThreadProxy::RunInThreadProxy(QObject *parent) : QObject(parent) { } void RunInThreadProxy::proxyCall(FunctionType func) { QObject *receiver = parent(); if (!receiver) receiver = qApp; QObject scope; connect(&scope, &QObject::destroyed, receiver, [func]() { (func)(); }, Qt::QueuedConnection); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/global.h000066400000000000000000000104231476226662200177600ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef GLOBAL_H #define GLOBAL_H #include #include #define MOUSE_MARGINS 10 #define DPP_BEGIN_NAMESPACE namespace deepin_platform_plugin { #define DPP_END_NAMESPACE } #define DPP_USE_NAMESPACE using namespace deepin_platform_plugin; #define PUBLIC_CLASS(Class, Target) \ class D##Class : public Class\ {friend class Target;} #define DEFINE_CONST_CHAR(Name) const char Name[] = "_d_" #Name DEFINE_CONST_CHAR(useDxcb); DEFINE_CONST_CHAR(useDwayland); DEFINE_CONST_CHAR(useNativeDxcb); DEFINE_CONST_CHAR(redirectContent); DEFINE_CONST_CHAR(netWmStates); DEFINE_CONST_CHAR(windowRadius); DEFINE_CONST_CHAR(borderWidth); DEFINE_CONST_CHAR(borderColor); DEFINE_CONST_CHAR(shadowRadius); DEFINE_CONST_CHAR(shadowOffset); DEFINE_CONST_CHAR(shadowColor); DEFINE_CONST_CHAR(windowStartUpEffect); DEFINE_CONST_CHAR(clipPath); DEFINE_CONST_CHAR(frameMask); DEFINE_CONST_CHAR(frameMargins); DEFINE_CONST_CHAR(translucentBackground); DEFINE_CONST_CHAR(enableCloseable); DEFINE_CONST_CHAR(windowEffect); DEFINE_CONST_CHAR(enableSystemResize); DEFINE_CONST_CHAR(enableSystemMove); DEFINE_CONST_CHAR(enableBlurWindow); DEFINE_CONST_CHAR(userWindowMinimumSize); DEFINE_CONST_CHAR(userWindowMaximumSize); DEFINE_CONST_CHAR(windowBlurAreas); DEFINE_CONST_CHAR(windowBlurPaths); DEFINE_CONST_CHAR(autoInputMaskByClipPath); DEFINE_CONST_CHAR(popupSystemWindowMenu); DEFINE_CONST_CHAR(groupLeader); DEFINE_CONST_CHAR(noTitlebar); DEFINE_CONST_CHAR(enableGLPaint); DEFINE_CONST_CHAR(windowInWorkSpace); // functions DEFINE_CONST_CHAR(setWmBlurWindowBackgroundArea); DEFINE_CONST_CHAR(setWmBlurWindowBackgroundPathList); DEFINE_CONST_CHAR(setWmBlurWindowBackgroundMaskImage); DEFINE_CONST_CHAR(setWmWallpaperParameter); DEFINE_CONST_CHAR(hasBlurWindow); DEFINE_CONST_CHAR(hasComposite); DEFINE_CONST_CHAR(hasNoTitlebar); DEFINE_CONST_CHAR(hasWindowAlpha); DEFINE_CONST_CHAR(hasWallpaperEffect); DEFINE_CONST_CHAR(windowManagerName); DEFINE_CONST_CHAR(connectWindowManagerChangedSignal); DEFINE_CONST_CHAR(connectHasBlurWindowChanged); DEFINE_CONST_CHAR(connectHasCompositeChanged); DEFINE_CONST_CHAR(connectHasNoTitlebarChanged); DEFINE_CONST_CHAR(connectHasWallpaperEffectChanged); DEFINE_CONST_CHAR(getWindows); DEFINE_CONST_CHAR(windowFromPoint); DEFINE_CONST_CHAR(getCurrentWorkspaceWindows); DEFINE_CONST_CHAR(connectWindowListChanged); DEFINE_CONST_CHAR(setMWMFunctions); DEFINE_CONST_CHAR(getMWMFunctions); DEFINE_CONST_CHAR(setMWMDecorations); DEFINE_CONST_CHAR(getMWMDecorations); DEFINE_CONST_CHAR(connectWindowMotifWMHintsChanged); DEFINE_CONST_CHAR(setWindowProperty); DEFINE_CONST_CHAR(pluginVersion); DEFINE_CONST_CHAR(disableOverrideCursor); DEFINE_CONST_CHAR(inputEventSourceDevice); DEFINE_CONST_CHAR(createGroupWindow); DEFINE_CONST_CHAR(destoryGroupWindow); DEFINE_CONST_CHAR(setWindowGroup); DEFINE_CONST_CHAR(clientLeader); DEFINE_CONST_CHAR(enableDxcb); DEFINE_CONST_CHAR(isEnableDxcb); DEFINE_CONST_CHAR(enableDwayland); DEFINE_CONST_CHAR(isEnableDwayland); DEFINE_CONST_CHAR(setEnableNoTitlebar); DEFINE_CONST_CHAR(setWindowRadius); DEFINE_CONST_CHAR(setBorderColor); DEFINE_CONST_CHAR(setShadowColor); DEFINE_CONST_CHAR(setShadowRadius); DEFINE_CONST_CHAR(setShadowOffset); DEFINE_CONST_CHAR(setBorderWidth); DEFINE_CONST_CHAR(setWindowEffect); DEFINE_CONST_CHAR(setWindowStartUpEffect); DEFINE_CONST_CHAR(isEnableNoTitlebar); DEFINE_CONST_CHAR(buildNativeSettings); DEFINE_CONST_CHAR(clearNativeSettings); DEFINE_CONST_CHAR(setWMClassName); DEFINE_CONST_CHAR(splitWindowOnScreen); DEFINE_CONST_CHAR(supportForSplittingWindow); DEFINE_CONST_CHAR(sendEndStartupNotifition); DEFINE_CONST_CHAR(splitWindowOnScreenByType); DEFINE_CONST_CHAR(supportForSplittingWindowByType); // others DEFINE_CONST_CHAR(WmWindowTypes); DEFINE_CONST_CHAR(WmNetDesktop); DEFINE_CONST_CHAR(WmClass); DEFINE_CONST_CHAR(ProcessId); enum DeviceType { UnknowDevice, TouchapdDevice, MouseDevice }; class QWindow; QWindow * fromQtWinId(WId id); DPP_BEGIN_NAMESPACE class RunInThreadProxy : public QObject { Q_OBJECT public: using FunctionType = std::function; explicit RunInThreadProxy(QObject *parent = nullptr); void proxyCall(FunctionType func); }; DPP_END_NAMESPACE #endif // GLOBAL_H qt5platform-plugins-5.7.12/src/src.cmake000066400000000000000000000025131476226662200201410ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later list(APPEND GLOBAL_HEADERS ${CMAKE_CURRENT_LIST_DIR}/dbackingstoreproxy.h ${CMAKE_CURRENT_LIST_DIR}/dnativesettings.h ${CMAKE_CURRENT_LIST_DIR}/dopenglpaintdevice.h ${CMAKE_CURRENT_LIST_DIR}/dxcbxsettings.h ${CMAKE_CURRENT_LIST_DIR}/global.h ${CMAKE_CURRENT_LIST_DIR}/vtablehook.h ${CMAKE_CURRENT_LIST_DIR}/dplatformsettings.h ${CMAKE_CURRENT_LIST_DIR}/ddesktopinputselectioncontrol.h ${CMAKE_CURRENT_LIST_DIR}/dinputselectionhandle.h ${CMAKE_CURRENT_LIST_DIR}/dapplicationeventmonitor.h ${CMAKE_CURRENT_LIST_DIR}/dselectedtexttooltip.h ) list(APPEND GLOBAL_SOURCES ${CMAKE_CURRENT_LIST_DIR}/dbackingstoreproxy.cpp ${CMAKE_CURRENT_LIST_DIR}/dnativesettings.cpp ${CMAKE_CURRENT_LIST_DIR}/dopenglpaintdevice.cpp ${CMAKE_CURRENT_LIST_DIR}/dxcbxsettings.cpp ${CMAKE_CURRENT_LIST_DIR}/global.cpp ${CMAKE_CURRENT_LIST_DIR}/vtablehook.cpp ${CMAKE_CURRENT_LIST_DIR}/dplatformsettings.cpp ${CMAKE_CURRENT_LIST_DIR}/ddesktopinputselectioncontrol.cpp ${CMAKE_CURRENT_LIST_DIR}/dinputselectionhandle.cpp ${CMAKE_CURRENT_LIST_DIR}/dapplicationeventmonitor.cpp ${CMAKE_CURRENT_LIST_DIR}/dselectedtexttooltip.cpp ) include_directories(${CMAKE_CURRENT_LIST_DIR}) qt5platform-plugins-5.7.12/src/src.pri000066400000000000000000000014131476226662200176510ustar00rootroot00000000000000HEADERS += \ $$PWD/dbackingstoreproxy.h \ $$PWD/dnativesettings.h \ $$PWD/dopenglpaintdevice.h \ $$PWD/dxcbxsettings.h \ $$PWD/global.h \ $$PWD/vtablehook.h \ $$PWD/dplatformsettings.h \ $$PWD/ddesktopinputselectioncontrol.h \ $$PWD/dinputselectionhandle.h \ $$PWD/dapplicationeventmonitor.h \ $$PWD/dselectedtexttooltip.h SOURCES += \ $$PWD/dbackingstoreproxy.cpp \ $$PWD/dnativesettings.cpp \ $$PWD/dopenglpaintdevice.cpp \ $$PWD/dxcbxsettings.cpp \ $$PWD/global.cpp \ $$PWD/vtablehook.cpp \ $$PWD/dplatformsettings.cpp \ $$PWD/ddesktopinputselectioncontrol.cpp \ $$PWD/dinputselectionhandle.cpp \ $$PWD/dapplicationeventmonitor.cpp \ $$PWD/dselectedtexttooltip.cpp INCLUDEPATH += $$PWD qt5platform-plugins-5.7.12/src/vtablehook.cpp000066400000000000000000000341471476226662200212220ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "vtablehook.h" #include #include #ifdef Q_OS_LINUX #include #include #include #include QT_BEGIN_NAMESPACE QFunctionPointer qt_linux_find_symbol_sys(const char *symbol); QT_END_NAMESPACE #endif DPP_BEGIN_NAMESPACE QMap VtableHook::objToOriginalVfptr; QMap VtableHook::objToGhostVfptr; QMap VtableHook::objDestructFun; static std::once_flag exitFlag; bool VtableHook::copyVtable(quintptr **obj) { int vtable_size = getVtableSize(obj); if (vtable_size == 0) return false; // 多开辟一个元素, 新的虚表结构如下: // 假设原虚表内存布局如下(考虑多继承): // C Vtable (7 entities) // +--------------------+ // struct C | offset_to_top (0) | // object +--------------------+ // 0 - struct A (primary base) | RTTI for C | // 0 - vptr_A -----------------------------> +--------------------+ // 8 - int ax | C::f0() | // 16 - struct B +--------------------+ // 16 - vptr_B ----------------------+ | C::f1() | // 24 - int bx | +--------------------+ // 28 - int cx | | offset_to_top (-16)| // sizeof(C): 32 align: 8 | +--------------------+ // | | RTTI for C | // +------> +--------------------+ // | Thunk C::f1() | // +--------------------+ // 则新的表结构为: // C Vtable (7 entities) C hooked Vtable (7 entities) // +--------------------+ +--------------------+ // struct C | offset_to_top (0) | | offset_to_top (0) | // object +--------------------+ +--------------------+ // 0 - struct A (primary base) | RTTI for C | | RTTI for C | // 0 - vptr_A -----------------------------// +--------------------+ //------> +--------------------+ // 8 - int ax | C::f0() |\ | C::f0() | (or override custom function pointer) // 16 - struct B +--------------------+ \ +--------------------+ // 16 - vptr_B ----------------------+ | C::f1() | \ | C::f1() | (or override custom function pointer) // 24 - int bx | +--------------------+ \ +--------------------+ // 28 - int cx | | offset_to_top (-16)| \ | offset_to_top (-16)| // sizeof(C): 32 align: 8 | +--------------------+ \ +--------------------+ // | | RTTI for C | + | RTTI for C | // +------> +--------------------+ | +--------------------+ // | Thunk C::f1() | | | Thunk C::f1() | // +--------------------+ | +--------------------+ // | | 0 | // | +--------------------+ // +----| original entry | // +--------------------+ quintptr *new_vtable = new quintptr[vtable_size + 2]; memcpy(new_vtable, adjustToTop(*obj), vtable_size * sizeof(quintptr)); new_vtable[vtable_size] = 0; //! save original vfptr objToOriginalVfptr[obj] = *obj; // 存储对象原虚表入口地址 new_vtable[vtable_size + 1] = quintptr(*obj); *obj = adjustToEntry(new_vtable); //! save ghost vfptr objToGhostVfptr[obj] = new_vtable; return true; } bool VtableHook::clearGhostVtable(const void *obj) { if (!objToOriginalVfptr.remove((quintptr **)obj)) // Uninitialized memory may have values, for resetVtable return false; objDestructFun.remove(obj); quintptr *vtable = objToGhostVfptr.take(obj); if (vtable) { delete[] vtable; return true; } return false; } void VtableHook::clearAllGhostVtable() { const QList _objects = objToGhostVfptr.keys(); for (const void *_obj : _objects) clearGhostVtable(_obj); } /*! * \brief 通过遍历尝试找到析构函数在虚表中的位置 * \param obj * \param destoryObjFun * \return */ int VtableHook::getDestructFunIndex(quintptr **obj, std::function destoryObjFun) { class _DestoryProbe { public: static quintptr probe(quintptr obj) { static quintptr _obj = 0; if (obj == 0) { obj = _obj; _obj = 0; } else { _obj = obj; } return obj; } static void nothing() { } }; quintptr *vtable = *obj; int vtable_size = getVtableSize(obj); if (vtable_size == 0) return -1; quintptr *new_vtable = new quintptr[vtable_size]; std::fill(adjustToEntry(new_vtable), new_vtable + vtable_size, quintptr(&_DestoryProbe::nothing)); // 给对象设置新的虚表 *obj = adjustToEntry(new_vtable); int index = -1; for (int i = adjustToEntry(0); i < vtable_size; ++i) { new_vtable[i] = quintptr(&_DestoryProbe::probe); // 尝试销毁此对象, 且观察_DestoryProbe::probe是否被调用 // 如果被调用, 则证明覆盖此虚函数能达到监控对象被销毁的目的 destoryObjFun(); if (_DestoryProbe::probe(0) == quintptr(obj)) { index = adjustToTop(i); break; } } // 恢复旧的虚表 *obj = vtable; // 销毁临时虚表 delete[] new_vtable; return index; } void VtableHook::autoCleanVtable(const void *obj) { quintptr fun = objDestructFun.value(obj); if (!fun) return; if (hasVtable(obj)) {// 需要判断一下,有可能在执行析构函数时虚表已经被删除 // clean clearGhostVtable(obj); } typedef void(*Destruct)(const void*); Destruct destruct = reinterpret_cast(fun); // call origin destruct function destruct(obj); } bool VtableHook::ensureVtable(const void *obj, std::function destoryObjFun) { quintptr **_obj = (quintptr**)(obj); if (objToOriginalVfptr.contains(_obj)) { // 不知道什么原因, 此时obj对象的虚表已经被还原 if (objToGhostVfptr.value((void *)obj) != adjustToTop(*_obj)) { clearGhostVtable((void*)obj); } else { return true; } } if (!copyVtable(_obj)) return false; // 查找对象的析构函数 int index = getDestructFunIndex(_obj, destoryObjFun); // 虚析构函数查找失败 if (index < 0) { qCWarning(vtableHook) << "Failed do override destruct function: " << obj; abort(); } quintptr *new_vtable = *_obj; // 保存对象真实的析构函数 objDestructFun[(void*)obj] = new_vtable[index]; // 覆盖析构函数, 用于在对象析构时自动清理虚表 new_vtable[index] = reinterpret_cast(&autoCleanVtable); // TODO: 由于未知原因,有的虚表会自动还原,导致虚析构不能正常HOOK,无法释放new出来的新虚表数组 // 这里在程序退出时进行统一释放。后面知道详细原因再进行修改。 std::call_once(exitFlag, std::bind(atexit, clearAllGhostVtable)); return true; } /*! * \brief VtableHook::hasVtable 对象的虚表已经被覆盖时返回true,否则返回false * \param obj * \return */ bool VtableHook::hasVtable(const void *obj) { quintptr **_obj = (quintptr**)(obj); return objToGhostVfptr.contains(_obj); } void VtableHook::resetVtable(const void *obj) { quintptr **_obj = (quintptr**)obj; int vtable_size = getVtableSize(_obj); // 获取obj对象原本虚表的入口 auto vtableHead = adjustToTop(*_obj); quintptr *vfptr_t2 = (quintptr*)vtableHead[vtable_size + 1]; // _obj - 2 + vtable_size + 1 if (!vfptr_t2) return; if (!clearGhostVtable(obj)) return; // 还原虚表 *_obj = vfptr_t2; } /*! * \brief 将偏移量为functionOffset的虚函数还原到原本的实现 * \param obj * \param functionIndex * \return 如果成功, 返回还原之前obj对象虚表中存储的函数指针, 否则返回0 */ quintptr VtableHook::resetVfptrFun(const void *obj, quintptr functionOffset) { quintptr *vfptr_t1 = *(quintptr **)obj; quintptr current_fun = *(vfptr_t1 + functionOffset / sizeof(quintptr)); quintptr origin_fun = originalFun(obj, functionOffset); if (!origin_fun) { return 0; } // reset to original fun *(vfptr_t1 + functionOffset / sizeof(quintptr)) = origin_fun; return current_fun; } /*! * \brief 获取obj对象偏移量为functionOffset的虚函数原本的函数指针 * \param obj * \param functionOffset * \return 如果obj对象虚表没有被覆盖, 或者函数偏移量正确, 将返回0 */ quintptr VtableHook::originalFun(const void *obj, quintptr functionOffset) { quintptr **_obj = (quintptr **)obj; if (!hasVtable(obj)) { qCWarning(vtableHook) << "Not override the object virtual table: " << obj; return 0; } Q_CHECK_PTR(_obj); int vtable_size = getVtableSize(_obj); // 获取obj对象原本虚表的入口 quintptr *vfptr_t2 = (quintptr*)(*_obj)[vtable_size - 1]; if (functionOffset > UINT_LEAST16_MAX) { qCWarning(vtableHook, "Is not a virtual function, function address: 0X%llx", functionOffset); return 0; } return *(vfptr_t2 + functionOffset / sizeof(quintptr)); } #if defined(Q_OS_LINUX) static int readProtFromPsm(quintptr adr, size_t length) { int prot = PROT_NONE; QString fname = "/proc/self/maps"; QFile f(fname); if (!f.open(QIODevice::ReadOnly)) { qFatal("%s", f.errorString().toStdString().data()); //return prot; // never be executed } QByteArray data = f.readAll(); bool ok = false; quintptr startAddr = 0, endAddr = 0; QTextStream ts(data); while (Q_UNLIKELY(!ts.atEnd())) { const QString line = ts.readLine(); const QStringList &maps = line.split(' '); if (Q_UNLIKELY(maps.size() < 3)) { continue; } //"00400000-00431000" "r--p" const QStringList addrs = maps.value(0).split('-'); startAddr = addrs.value(0).toULongLong(&ok, 16); Q_ASSERT(ok); endAddr = addrs.value(1).toULongLong(&ok, 16); Q_ASSERT(ok); if (Q_LIKELY(adr >= endAddr)) { continue; } if (adr >= startAddr && adr + length <= endAddr) { QString ps = maps.value(1); //qDebug() << maps.value(0) << maps.value(1); for (QChar c : ps) { switch (c.toLatin1()) { case 'r': prot |= PROT_READ; break; case 'w': prot |= PROT_WRITE; break; case 'x': prot |= PROT_EXEC; break; default: break; // '-' 'p' don't care } } break; } else if (adr < startAddr) { qFatal("%p not found in proc maps", reinterpret_cast(adr)); //break; // 超出了地址不需要再去检查了 } } return prot; } #endif bool VtableHook::forceWriteMemory(void *adr, const void *data, size_t length) { #ifdef Q_OS_LINUX int page_size = sysconf(_SC_PAGESIZE); quintptr x = reinterpret_cast(adr); // 不减去一个pagesize防止跨越两个数据区域(对应/proc/self/maps两行数据) void *new_adr = reinterpret_cast((x /*- page_size - 1*/) & ~(page_size - 1)); size_t override_data_length = length + x - reinterpret_cast(new_adr); int oldProt = readProtFromPsm(quintptr(new_adr), override_data_length); bool writeable = oldProt & PROT_WRITE; // 增加判断是否已经可写,不能写才调用。 // 失败时直接放弃 if (!writeable && mprotect(new_adr, override_data_length, PROT_READ | PROT_WRITE)) { qWarning() << "mprotect(change) failed" << strerror(errno); return false; } #endif // 复制数据 memcpy(adr, data, length); #ifdef Q_OS_LINUX // 恢复内存标志位 if (!writeable && mprotect(new_adr, override_data_length, oldProt)) { qWarning() << "mprotect(restore) failed" << strerror(errno); return false; } #endif return true; } QFunctionPointer VtableHook::resolve(const char *symbol) { #ifdef Q_OS_LINUX /** * !!不要使用qt_linux_find_symbol_sys函数去获取符号 * * 在龙芯平台上,qt_linux_find_symbol_sys 无法获取部分已加载动态库的符号, * 可能的原因是这个函数对 dlsym 的调用是在 libQt5Core 动态库中,这个库加载的比较早, * 有可能是因此导致无法获取比这个库加载更晚的库中的符号(仅为猜测) */ return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol)); #else // TODO return nullptr; #endif } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/src/vtablehook.h000066400000000000000000000340671476226662200206700ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef VTABLEHOOK_H #define VTABLEHOOK_H #include #include #include #include #include "global.h" #include DPP_BEGIN_NAMESPACE #ifndef QT_DEBUG inline Q_LOGGING_CATEGORY(vtableHook, "deepin.qpa.vtableHook", QtInfoMsg); #else inline Q_LOGGING_CATEGORY(vtableHook, "deepin.qpa.vtableHook"); #endif static inline quintptr toQuintptr(void *ptr) { return *(quintptr*)ptr; } static inline int getVtableSize(quintptr **obj) { quintptr *begin = *obj; while (true) { if ((int64_t)*begin == 0 or (int64_t)*begin < QSysInfo::WordSize) // offset will grater than 8 bytes(64 bit) break; ++begin; } return begin - *obj + 2; // for offset and rtti info } // http://refspecs.linux-foundation.org/cxxabi-1.83.html#vtable class VtableHook { public: static inline quintptr *getVtableOfObject(const void *obj) { return *(quintptr**)obj; } template static quintptr *getVtableOfClass() { QByteArray vtable_symbol(typeid(T).name()); vtable_symbol.prepend("_ZTV"); quintptr *vfptr_t1 = reinterpret_cast(resolve(vtable_symbol.constData())); return vfptr_t1 ? adjustToEntry(vfptr_t1) : nullptr; } static int getDestructFunIndex(quintptr **obj, std::function destoryObjFun); static constexpr const QObject *getQObject(...) { return nullptr;} static constexpr const QObject *getQObject(const QObject *obj) { return obj;} static void autoCleanVtable(const void *obj); static bool ensureVtable(const void *obj, std::function destoryObjFun); static bool hasVtable(const void *obj); static void resetVtable(const void *obj); static quintptr resetVfptrFun(const void *obj, quintptr functionOffset); template // for class static inline quintptr resetVfptrFun(Fun fun) { typedef QtPrivate::FunctionPointer FunInfo; return resetVfptrFun(getVtableOfClass(), toQuintptr(&fun)); } static quintptr originalFun(const void *obj, quintptr functionOffset); static bool forceWriteMemory(void *adr, const void *data, size_t length); static QFunctionPointer resolve(const char *symbol); template class OverrideDestruct : public T { ~OverrideDestruct() override;}; template struct CheckCompatibleArguments { enum { value = false }; }; template struct CheckCompatibleArguments { enum { value = true }; }; template static bool overrideVfptrFun(quintptr *vfptr_t1, Fun1 fun1, quintptr *vfptr_t2, Fun2 fun2, bool forceWrite) { typedef QtPrivate::FunctionPointer FunInfo1; typedef QtPrivate::FunctionPointer FunInfo2; //compilation error if the arguments does not match. Q_STATIC_ASSERT_X((CheckCompatibleArguments::value), "Function1 and Function2 arguments are not compatible."); Q_STATIC_ASSERT_X((CheckCompatibleArguments, QtPrivate::List>::value), "Function1 and Function2 return type are not compatible.."); //! ({code}) in the form of a code is to eliminate - Wstrict - aliasing build warnings quintptr fun1_offset = toQuintptr(&fun1); quintptr fun2_offset = toQuintptr(&fun2); if (fun1_offset < 0 || fun1_offset > UINT_LEAST16_MAX) return false; quintptr *vfun = vfptr_t1 + fun1_offset / sizeof(quintptr); // if the fun2 is not virtual function if (fun2_offset <= UINT_LEAST16_MAX) { fun2_offset = *(vfptr_t2 + fun2_offset / sizeof(quintptr)); } if (forceWrite) return forceWriteMemory(vfun, &fun2_offset, sizeof(fun2_offset)); *vfun = fun2_offset; return true; } template static bool overrideVfptrFun(const typename QtPrivate::FunctionPointer::Object *t1, Fun1 fun1, const typename QtPrivate::FunctionPointer::Object *t2, Fun2 fun2) { typedef QtPrivate::FunctionPointer FunInfo1; // 检查析构函数是否为虚 class OverrideDestruct : public FunInfo1::Object { ~OverrideDestruct() override;}; //TODO: we can use std::has_virtual_destructor if (!ensureVtable((void*)t1, std::bind(&_destory_helper, t1))) { return false; } quintptr *vfptr_t1 = getVtableOfObject(t1); quintptr *vfptr_t2 = getVtableOfObject(t2); bool ok = overrideVfptrFun(vfptr_t1, fun1, vfptr_t2, fun2, false); if (!ok) { // 恢复旧环境 resetVtable(t1); } return ok; } template static bool overrideVfptrFun(Fun1 fun1, const typename QtPrivate::FunctionPointer::Object *t2, Fun2 fun2) { typedef QtPrivate::FunctionPointer FunInfo1; quintptr *vfptr_t1 = getVtableOfClass(); if (!vfptr_t1) { abort(); } quintptr *vfptr_t2 = getVtableOfObject(t2); return overrideVfptrFun(vfptr_t1, fun1, vfptr_t2, fun2, true); } template struct FunctionPointer { }; template struct FunctionPointer { typedef QtPrivate::List Arguments; }; template struct FunctionPointer { typedef QtPrivate::List Arguments; }; template static typename std::enable_if::ArgumentCount >= 0, bool>::type overrideVfptrFun(quintptr *vfptr_t1, Fun1 fun1, Fun2 fun2, bool forceWrite) { typedef QtPrivate::FunctionPointer FunInfo1; typedef QtPrivate::FunctionPointer FunInfo2; Q_STATIC_ASSERT(!FunInfo2::IsPointerToMemberFunction); //compilation error if the arguments does not match. Q_STATIC_ASSERT_X((CheckCompatibleArguments::Arguments, typename FunInfo2::Arguments>::value), "Function1 and Function2 arguments are not compatible."); Q_STATIC_ASSERT_X((CheckCompatibleArguments, QtPrivate::List>::value), "Function1 and Function2 return type are not compatible.."); //! ({code}) in the form of a code is to eliminate - Wstrict - aliasing build warnings quintptr fun1_offset = toQuintptr(&fun1); quintptr fun2_offset = toQuintptr(&fun2); if (fun1_offset < 0 || fun1_offset > UINT_LEAST16_MAX) return false; quintptr *vfun = vfptr_t1 + fun1_offset / sizeof(quintptr); if (forceWrite) return forceWriteMemory(vfun, &fun2_offset, sizeof(fun2_offset)); *vfun = fun2_offset; return true; } template struct StdFunWrap {}; template struct StdFunWrap { typedef std::function StdFunType; static inline StdFunType fun(StdFunType f, bool check = true) { static StdFunType fun = f; static bool initialized = false; if (initialized && check) { qCWarning(vtableHook, "The StdFunWrap is dirty! Don't use std::bind(use lambda functions)."); } initialized = true; return fun; } static Ret call(Obj *o, Args... args) { return fun(call, false)(o, std::forward(args)...); } }; template struct StdFunWrap : StdFunWrap{}; template static inline typename std::enable_if::ArgumentCount == -1, bool>::type overrideVfptrFun(quintptr *vfptr_t1, Fun1 fun1, Fun2 fun2, bool forceWrite) { typedef QtPrivate::FunctionPointer FunInfo1; const int FunctorArgumentCount = QtPrivate::ComputeFunctorArgumentCount::Arguments>::Value; Q_STATIC_ASSERT_X((FunctorArgumentCount >= 0), "Function1 and Function2 arguments are not compatible."); const int Fun2ArgumentCount = (FunctorArgumentCount >= 0) ? FunctorArgumentCount : 0; typedef typename QtPrivate::FunctorReturnType::Arguments, Fun2ArgumentCount>::Value>::Value Fun2ReturnType; Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible::value), "Function1 and Function2 return type are not compatible."); StdFunWrap::fun(fun2); return overrideVfptrFun(vfptr_t1, fun1, StdFunWrap::call, forceWrite); } /*! * \fn template static bool overrideVfptrFun(const typename QtPrivate::FunctionPointer::Object *t1, Fun1 fun1, Fun2 fun2) * * \note 重载多继承类中的多个虚函数时,fun1务必标记成一个类名的函数。否则可能出现内存泄露的情况 * \note 例如 class A 继承于 B,C,D,当需要重载B中的foo1,C中的foo2时,以下函数的fun1需要统一标记为&A::foo1和&A::foo2 * \note 因为如果分开写为&B::foo1和&C::foo2的话,指针转换内部会记录多张虚表,重载多份析构函数,可能导致最开始的部分无法正常析构! */ template static bool overrideVfptrFun(const typename QtPrivate::FunctionPointer::Object *t1, Fun1 fun1, Fun2 fun2) //THIS { typedef QtPrivate::FunctionPointer FunInfo1; // 检查析构函数是否为虚 class OverrideDestruct : public FunInfo1::Object { ~OverrideDestruct() override;}; if (!ensureVtable((void*)t1, std::bind(&_destory_helper, t1))) { return false; } bool ok = overrideVfptrFun(getVtableOfObject(t1), fun1, fun2, false); if (!ok) { // 恢复旧环境 resetVtable(t1); } return true; } template static bool overrideVfptrFun(Fun1 fun1, Fun2 fun2) { quintptr *vfptr_t1 = getVtableOfClass(); if (!vfptr_t1) { abort(); } return overrideVfptrFun(vfptr_t1, fun1, fun2, true); } template static bool overrideVfptrFun(Fun1 fun1, Fun2 fun2) { typedef QtPrivate::FunctionPointer FunInfo1; return overrideVfptrFun(fun1, fun2); } template static bool resetVfptrFun(const typename QtPrivate::FunctionPointer::Object *obj, Fun1 fun) { return resetVfptrFun((void*)obj, toQuintptr(&fun)) > 0; } template static Fun originalFun(const typename QtPrivate::FunctionPointer::Object *obj, Fun fun) { quintptr o_fun = originalFun((void*)obj, toQuintptr(&fun)); return *reinterpret_cast(o_fun); } template static typename QtPrivate::FunctionPointer::ReturnType callOriginalFun(typename QtPrivate::FunctionPointer::Object *obj, Fun fun, Args&&... args) { quintptr fun_offset = toQuintptr(&fun); class _ResetVFun { public: ~_ResetVFun() { *(vfptr + offset / sizeof(quintptr)) = oldFun; } quintptr *vfptr = nullptr; quint16 offset = 0; quintptr oldFun = 0; }; _ResetVFun rvf; rvf.vfptr = *(quintptr**)(obj); rvf.offset = fun_offset; rvf.oldFun = resetVfptrFun((void*)obj, fun_offset); if (!rvf.oldFun) { qCWarning(vtableHook) << "Reset the function failed, object address:" << static_cast(obj); abort(); } // call return (obj->*fun)(std::forward(args)...); } private: static bool copyVtable(quintptr **obj); static bool clearGhostVtable(const void *obj); static void clearAllGhostVtable(); template static T adjustToTop(T obj) // vtableTop: vtable start address, Usually refers to offset_to_top { // this function should'n be called when entry is parent entry using fundamentalType = typename std::remove_cv::type>::type; return obj - static_cast(2); // vtable start address = vtable entry - 2 } template static T adjustToEntry(T obj) // vtableEntry: is located after rtti in the virtual table { // this function should'n be called when entry is parent entry using fundamentalType = typename std::remove_cv::type>::type; return obj + static_cast(2); // vtable entry = vtable start address + 2 } template static void _destory_helper(const T *obj) { delete obj; } static QMap objToOriginalVfptr; static QMap objToGhostVfptr; static QMap objDestructFun; }; DPP_END_NAMESPACE #define HookReset VtableHook::resetVfptrFun #define HookCall VtableHook::callOriginalFun #define HookOverride VtableHook::overrideVfptrFun #endif // VTABLEHOOK_H qt5platform-plugins-5.7.12/tests/000077500000000000000000000000001476226662200167225ustar00rootroot00000000000000qt5platform-plugins-5.7.12/tests/CMakeLists.txt000066400000000000000000000037571476226662200214760ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later project(ut-platformplugins) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Widgets Concurrent Test) find_package(GTest REQUIRED) if(${QT_VERSION_MAJOR} STREQUAL "5") find_package(Qt5 REQUIRED COMPONENTS XcbQpa X11Extras EdidSupport XkbCommonSupport) else() find_package(Qt6 REQUIRED COMPONENTS OpenGL XcbQpaPrivate) endif() add_definitions(-DDXCB_VERSION=\"${DTK_VERSION}\") if(CMAKE_BUILD_TYPE STREQUAL "Release") add_definitions(-DQT_NO_DEBUG_OUTPUT=TRUE) endif() file(GLOB test_SRC test.h main.cpp src/*.cpp) add_executable(${PROJECT_NAME} ${test_SRC}) include(${CMAKE_SOURCE_DIR}/xcb/linux.cmake) add_definitions(-DPLUGIN_OUTPUT_PATH=\"${LIBRARY_OUTPUT_PATH}/..\") target_compile_options(${PROJECT_NAME} PRIVATE -fno-access-control -fsanitize=address) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${PROJECT_NAME} PRIVATE -fprofile-instr-generate -ftest-coverage) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(${PROJECT_NAME} PRIVATE -fprofile-arcs -ftest-coverage) endif() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/xcb ) target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::Test GTest::GTest gmock pthread m gcov -ldl dxcb ) if(${QT_VERSION_MAJOR} STREQUAL "5") target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::XcbQpa Qt5::EdidSupport Qt5::EdidSupportPrivate Qt5::XkbCommonSupport Qt5::XkbCommonSupportPrivate Qt5::X11Extras ) else() target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::OpenGL Qt6::OpenGLPrivate Qt6::XcbQpaPrivate) endif() qt5platform-plugins-5.7.12/tests/main.cpp000066400000000000000000000012721476226662200203540ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #ifdef QT_DEBUG #include #endif int main(int argc, char *argv[]) { qputenv("QT_PLUGIN_PATH", PLUGIN_OUTPUT_PATH); // gerrit编译时没有显示器,需要指定环境变量 if (!qEnvironmentVariableIsSet("DISPLAY")) qputenv("QT_QPA_PLATFORM", "offscreen"); QApplication app(argc, argv); ::testing::InitGoogleTest(&argc, argv); int ret = RUN_ALL_TESTS(); #ifdef QT_DEBUG __sanitizer_set_report_path("asan.log"); #endif return ret; } qt5platform-plugins-5.7.12/tests/src/000077500000000000000000000000001476226662200175115ustar00rootroot00000000000000qt5platform-plugins-5.7.12/tests/src/ut_dapplicationeventmonitor.cpp000066400000000000000000000013041476226662200260440ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "dapplicationeventmonitor.h" DPP_USE_NAMESPACE class TDApplicationEventMonitor : public testing::Test { protected: void SetUp(); void TearDown(); DApplicationEventMonitor *monitor = nullptr; }; void TDApplicationEventMonitor::SetUp() { monitor = new DApplicationEventMonitor; } void TDApplicationEventMonitor::TearDown() { delete monitor; } TEST_F(TDApplicationEventMonitor, lastInputDeviceType) { ASSERT_EQ(monitor->lastInputDeviceType(), DApplicationEventMonitor::None); } qt5platform-plugins-5.7.12/tests/src/ut_dbackingstoreproxy.cpp000066400000000000000000000020061476226662200246440ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "dbackingstoreproxy.h" DPP_USE_NAMESPACE class TDBackingStoreProxy : public testing::Test { protected: void SetUp(); void TearDown(); QWindow *window; }; void TDBackingStoreProxy::SetUp() { window = new QWindow; } void TDBackingStoreProxy::TearDown() { delete window; } TEST_F(TDBackingStoreProxy, useGLPaint) { ASSERT_FALSE(DBackingStoreProxy::useGLPaint(window)); window->setSurfaceType(QSurface::OpenGLSurface); window->setProperty("_d_enableGLPaint", QVariant::fromValue(true)); ASSERT_TRUE(DBackingStoreProxy::useGLPaint(window)); } TEST_F(TDBackingStoreProxy, useWallpaperPaint) { ASSERT_FALSE(DBackingStoreProxy::useWallpaperPaint(window)); window->setProperty("_d_dxcb_wallpaper", QVariant::fromValue(true)); ASSERT_TRUE(DBackingStoreProxy::useWallpaperPaint(window)); } qt5platform-plugins-5.7.12/tests/src/ut_ddesktopinputselectioncontrol.cpp000066400000000000000000000026351476226662200271370ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "dinputselectionhandle.h" #include "dapplicationeventmonitor.h" #define private public #include "ddesktopinputselectioncontrol.h" #undef private DPP_USE_NAMESPACE class TDDesktopInputSelectionControl : public testing::Test { protected: void SetUp(); void TearDown(); DDesktopInputSelectionControl *control = nullptr; DApplicationEventMonitor *monitor = nullptr; }; void TDDesktopInputSelectionControl::SetUp() { control = new DDesktopInputSelectionControl(nullptr, qApp->inputMethod()); monitor = new DApplicationEventMonitor; } void TDDesktopInputSelectionControl::TearDown() { delete control; delete monitor; } TEST_F(TDDesktopInputSelectionControl, createHandles) { ASSERT_TRUE(control->m_anchorSelectionHandle.isNull()); ASSERT_TRUE(control->m_cursorSelectionHandle.isNull()); control->createHandles(); ASSERT_FALSE(control->m_anchorSelectionHandle.isNull()); ASSERT_FALSE(control->m_cursorSelectionHandle.isNull()); } TEST_F(TDDesktopInputSelectionControl, setApplicationEventMonitor) { ASSERT_TRUE(control->m_pApplicationEventMonitor.isNull()); control->setApplicationEventMonitor(monitor); ASSERT_FALSE(control->m_pApplicationEventMonitor.isNull()); } qt5platform-plugins-5.7.12/tests/src/ut_dframewindow.cpp000066400000000000000000000106211476226662200234130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "dframewindow.h" #include "global.h" DPP_USE_NAMESPACE class TDFramewindow : public testing::Test { protected: void SetUp(); void TearDown(); QWindow *window = nullptr; DFrameWindow *frameWindow = nullptr; }; void TDFramewindow::SetUp() { window = new QWindow; frameWindow = new DFrameWindow(window); } void TDFramewindow::TearDown() { delete window; delete frameWindow; } TEST_F(TDFramewindow, contentWindow) { QWindow *w = frameWindow->contentWindow(); ASSERT_TRUE(w); ASSERT_EQ(w, window); } TEST_F(TDFramewindow, shadowRadius) { int shadowRadius = frameWindow->shadowRadius(); ASSERT_EQ(shadowRadius, 60); frameWindow->setShadowRadius(80); shadowRadius = frameWindow->shadowRadius(); ASSERT_EQ(shadowRadius, 80); } TEST_F(TDFramewindow, shadowOffset) { QPoint shadowOffset = frameWindow->shadowOffset(); ASSERT_EQ(shadowOffset, QPoint(0, 16)); frameWindow->setShadowOffset(QPoint(0, 17)); shadowOffset = frameWindow->shadowOffset(); ASSERT_EQ(shadowOffset, QPoint(0, 17)); } TEST_F(TDFramewindow, shadowColor) { QColor shadowColor = frameWindow->shadowColor(); ASSERT_EQ(shadowColor, QColor(0, 0, 0, 255 * 0.6)); frameWindow->setShadowColor(QColor(0, 0, 0, 255 * 0.7)); shadowColor = frameWindow->shadowColor(); ASSERT_EQ(shadowColor, QColor(0, 0, 0, 255 * 0.7)); } TEST_F(TDFramewindow, borderWidth) { int borderWidth = frameWindow->borderWidth(); ASSERT_EQ(borderWidth, 1); frameWindow->setBorderWidth(2); borderWidth = frameWindow->borderWidth(); ASSERT_EQ(borderWidth, 2); } TEST_F(TDFramewindow, borderColor) { QColor borderColor = frameWindow->borderColor(); ASSERT_EQ(borderColor, QColor(0, 0, 0, 255 * 0.15)); frameWindow->setBorderColor(QColor(0, 0, 0, 255 * 0.2)); borderColor = frameWindow->borderColor(); ASSERT_EQ(borderColor, QColor(0, 0, 0, 255 * 0.2)); } TEST_F(TDFramewindow, setContentPath) { QPainterPath path; path.addRect(0, 0, 100, 100); frameWindow->setContentPath(path); QPainterPath painterPath = frameWindow->contentPath(); ASSERT_EQ(path, painterPath); } TEST_F(TDFramewindow, setContentRoundedRect) { QRect rect{0, 0, 100, 100}; frameWindow->setContentRoundedRect(rect, 8); QPainterPath painterPath = frameWindow->contentPath(); QPainterPath path; path.addRoundedRect(rect, 8, 8); ASSERT_EQ(path, painterPath); } TEST_F(TDFramewindow, contentMarginsHint) { int radius = frameWindow->shadowRadius(); QPoint offset = frameWindow->shadowOffset(); int borderWidth = frameWindow->borderWidth(); QMargins margins = QMargins(qMax(radius - offset.x(), borderWidth), qMax(radius - offset.y(), borderWidth), qMax(radius + offset.x(), borderWidth), qMax(radius + offset.y(), borderWidth)); QMargins actMargins = frameWindow->contentMarginsHint(); ASSERT_EQ(margins, actMargins); } TEST_F(TDFramewindow, contentOffsetHint) { QMargins margins = frameWindow->contentMarginsHint(); QPoint point(margins.left(), margins.top()); QPoint actPoint = frameWindow->contentOffsetHint(); ASSERT_EQ(point, actPoint); } TEST_F(TDFramewindow, isClearContentAreaForShadowPixmap) { bool isClear = frameWindow->isClearContentAreaForShadowPixmap(); ASSERT_EQ(isClear, false); frameWindow->setClearContentAreaForShadowPixmap(true); isClear = frameWindow->isClearContentAreaForShadowPixmap(); ASSERT_EQ(isClear, true); } TEST_F(TDFramewindow, isEnableSystemResize) { bool enableSystemResize = frameWindow->isEnableSystemResize(); ASSERT_EQ(enableSystemResize, true); frameWindow->setEnableSystemResize(false); enableSystemResize = frameWindow->isEnableSystemResize(); ASSERT_EQ(enableSystemResize, false); } TEST_F(TDFramewindow, isEnableSystemMove) { bool enableSystemMove = frameWindow->isEnableSystemMove(); ASSERT_EQ(enableSystemMove, true); frameWindow->setEnableSystemMove(false); enableSystemMove = frameWindow->isEnableSystemMove(); ASSERT_EQ(enableSystemMove, false); } TEST_F(TDFramewindow, redirectContent) { bool redirectContent = frameWindow->redirectContent(); ASSERT_EQ(redirectContent, false); } qt5platform-plugins-5.7.12/tests/src/ut_dinputselectionhandle.cpp000066400000000000000000000024741476226662200253210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "dinputselectionhandle.h" #include "ddesktopinputselectioncontrol.h" DPP_USE_NAMESPACE class TDInputSelectionHandle : public testing::Test { protected: void SetUp(); void TearDown(); DInputSelectionHandle *handle = nullptr; DDesktopInputSelectionControl *control = nullptr; }; void TDInputSelectionHandle::SetUp() { control = new DDesktopInputSelectionControl(nullptr, qApp->inputMethod()); handle = new DInputSelectionHandle(DInputSelectionHandle::Up, control); } void TDInputSelectionHandle::TearDown() { delete handle; delete control; } TEST_F(TDInputSelectionHandle, handlePosition) { ASSERT_EQ(handle->handlePosition(), DInputSelectionHandle::Up); } TEST_F(TDInputSelectionHandle, setHandlePosition) { handle->setHandlePosition(DInputSelectionHandle::Down); ASSERT_EQ(handle->handlePosition(), DInputSelectionHandle::Down); handle->setHandlePosition(DInputSelectionHandle::Up); ASSERT_EQ(handle->handlePosition(), DInputSelectionHandle::Up); } TEST_F(TDInputSelectionHandle, handleImageSize) { auto size = handle->handleImageSize(); ASSERT_TRUE(!size.isNull()); } qt5platform-plugins-5.7.12/tests/src/ut_dnativesettings.cpp000066400000000000000000000013411476226662200241370ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include "dnativesettings.h" DPP_USE_NAMESPACE class TDNativeSettings : public testing::Test { protected: void SetUp(); void TearDown(); QWindow *window = nullptr; }; void TDNativeSettings::SetUp() { window = new QWindow; } void TDNativeSettings::TearDown() { delete window; } TEST_F(TDNativeSettings, getSettingsProperty) { QByteArray array = DNativeSettings::getSettingsProperty(window); window->setProperty("_d_domain", "/test/test"); array = DNativeSettings::getSettingsProperty(window); ASSERT_EQ(array, "_TEST_TEST"); } qt5platform-plugins-5.7.12/tests/src/ut_dnotitlebarwindowhelper.cpp000066400000000000000000000037621476226662200256740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include #include "dnotitlebarwindowhelper.h" DPP_USE_NAMESPACE class TDNoTitlebarWindowHelper : public testing::Test { protected: void SetUp(); void TearDown(); QWindow *window = nullptr; DNoTitlebarWindowHelper *helper = nullptr; }; void TDNoTitlebarWindowHelper::SetUp() { window = new QWindow; window->create(); helper = new DNoTitlebarWindowHelper(window, window->winId()); } void TDNoTitlebarWindowHelper::TearDown() { delete window; } TEST_F(TDNoTitlebarWindowHelper, theme) { QString theme = helper->property("theme").toString(); ASSERT_EQ(theme, helper->theme()); helper->setTheme("test"); ASSERT_EQ("test", helper->theme()); helper->setTheme("deepin"); ASSERT_EQ("deepin", helper->theme()); } TEST_F(TDNoTitlebarWindowHelper, windowRadius) { helper->setWindowRadius(QPointF(0.1, 0.1)); ASSERT_EQ(QPointF(0.1, 0.1), helper->windowRadius()); } TEST_F(TDNoTitlebarWindowHelper, borderWidth) { helper->setBorderWidth(2.0); ASSERT_EQ(2.0, helper->borderWidth()); } TEST_F(TDNoTitlebarWindowHelper, borderColor) { helper->setBorderColor(Qt::red); ASSERT_EQ(QColor(Qt::red), helper->borderColor()); } TEST_F(TDNoTitlebarWindowHelper, shadowRadius) { helper->setShadowRadius(2.0); ASSERT_EQ(2.0, helper->shadowRadius()); } TEST_F(TDNoTitlebarWindowHelper, shadowOffset) { helper->setShadowOffect(QPointF(1.0, 1.0)); ASSERT_EQ(QPointF(1.0, 1.0), helper->shadowOffset()); } TEST_F(TDNoTitlebarWindowHelper, shadowColor) { helper->setShadowColor(Qt::blue); ASSERT_EQ(QColor(Qt::blue), helper->shadowColor()); } TEST_F(TDNoTitlebarWindowHelper, mouseInputAreaMargins) { helper->setMouseInputAreaMargins(QMarginsF(1.0, 1.0, 1.0 ,1.0)); ASSERT_EQ(QMarginsF(1.0, 1.0, 1.0 ,1.0), helper->mouseInputAreaMargins()); } qt5platform-plugins-5.7.12/tests/src/ut_dopenglpaintdevice.cpp000066400000000000000000000017731476226662200246010ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include #include #include "dopenglpaintdevice.h" DPP_USE_NAMESPACE static void drawColoredRects(QPainter *p, const QSize &size) { p->fillRect(0, 0, size.width() / 2, size.height() / 2, Qt::red); p->fillRect(size.width() / 2, 0, size.width() / 2, size.height() / 2, Qt::green); p->fillRect(size.width() / 2, size.height() / 2, size.width() / 2, size.height() / 2, Qt::blue); p->fillRect(0, size.height() / 2, size.width() / 2, size.height() / 2, Qt::white); } TEST(TDOpenGLPaintDevice, OpenGLPaintDevice) { const QSize size(128, 128); DOpenGLPaintDevice device(size); QPainter p; ASSERT_TRUE(p.begin(&device)); drawColoredRects(&p, device.size()); p.end(); ASSERT_TRUE(device.isValid()); ASSERT_EQ(device.grabFramebuffer().size(), size); } qt5platform-plugins-5.7.12/tests/src/ut_dxcbxsettings.cpp000066400000000000000000000051551476226662200236240ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include #include "dxcbxsettings.h" #include "dplatformintegration.h" DPP_USE_NAMESPACE static const QByteArray TEST_VALUE("Test/Value"); static bool testPropertyChangedCallback = false; static void propertyChangedfunc(xcb_connection_t *, const QByteArray &, const QVariant &, void *) { testPropertyChangedCallback = true; } class TDXcbXSettings : public testing::Test { protected: void SetUp(); void TearDown(); DXcbXSettings *settings = nullptr; }; void TDXcbXSettings::SetUp() { settings = DPlatformIntegration::instance()->xSettings(); settings->setSetting(TEST_VALUE, 100); } void TDXcbXSettings::TearDown() { settings->setSetting(TEST_VALUE, QVariant()); testPropertyChangedCallback = false; } TEST_F(TDXcbXSettings, getOwner) { xcb_window_t id = DXcbXSettings::getOwner(); ASSERT_NE(id, 0); } TEST_F(TDXcbXSettings, initialized) { bool isInitialized = settings->initialized(); ASSERT_TRUE(isInitialized); } TEST_F(TDXcbXSettings, isEmpty) { bool isEmpty = settings->isEmpty(); ASSERT_FALSE(isEmpty); } TEST_F(TDXcbXSettings, contains) { bool isContained = settings->contains(TEST_VALUE); ASSERT_TRUE(isContained); isContained = settings->contains("test"); ASSERT_FALSE(isContained); } TEST_F(TDXcbXSettings, setSetting) { settings->setSetting(TEST_VALUE, 200); QVariant value = settings->setting(TEST_VALUE); bool ok = false; int blink = value.toInt(&ok); ASSERT_TRUE(ok); ASSERT_EQ(blink, 200); } TEST_F(TDXcbXSettings, settingKeys) { ASSERT_TRUE(!settings->settingKeys().isEmpty()); } TEST_F(TDXcbXSettings, registerCallback) { ASSERT_FALSE(testPropertyChangedCallback); settings->registerCallback(propertyChangedfunc, (void *)&propertyChangedfunc); QVariant oldValue = settings->setting(TEST_VALUE); settings->setSetting(TEST_VALUE, oldValue.toInt() + 1); ASSERT_TRUE(testPropertyChangedCallback); settings->removeCallbackForHandle((void *)&propertyChangedfunc); } TEST_F(TDXcbXSettings, registerCallbackForProperty) { ASSERT_FALSE(testPropertyChangedCallback); settings->registerCallbackForProperty(TEST_VALUE, propertyChangedfunc, (void *)&propertyChangedfunc); QVariant oldValue = settings->setting(TEST_VALUE); settings->setSetting(TEST_VALUE, oldValue.toInt() + 1); ASSERT_TRUE(testPropertyChangedCallback); settings->removeCallbackForHandle(TEST_VALUE, (void *)&propertyChangedfunc); } qt5platform-plugins-5.7.12/tests/src/ut_global.cpp000066400000000000000000000017631476226662200221740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include #include #include "global.h" class TGlobal : public testing::Test { protected: void SetUp(); void TearDown(); QWindow *window = nullptr; }; void TGlobal::SetUp() { window = new QWindow; } void TGlobal::TearDown() { delete window; } TEST_F(TGlobal, fromQtWinId) { QWindow *w = fromQtWinId(window->winId()); ASSERT_EQ(w, window); } TEST(TRunInThreadProxy, callInThread) { DPP_USE_NAMESPACE; QThread *calledThread = nullptr; auto feature = QtConcurrent::run([&calledThread]() { RunInThreadProxy proxy; proxy.proxyCall([&calledThread]() { calledThread = QThread::currentThread(); }); }); feature.waitForFinished(); QCoreApplication::processEvents(); ASSERT_EQ(qApp->thread(), calledThread); } qt5platform-plugins-5.7.12/tests/src/ut_utility.cpp000066400000000000000000000030071476226662200224300ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include "utility.h" #include #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #else #include #endif TEST(TUtility, dropShadow) { QPixmap pixmap; QImage image = Utility::dropShadow(pixmap, 4, QColor(255, 255, 0)); ASSERT_TRUE(image.isNull()); pixmap = QPixmap(100, 100); image = Utility::dropShadow(pixmap, 4, QColor(255, 255, 0)); ASSERT_FALSE(image.isNull()); ASSERT_TRUE(image.size() == QSize(100 + 2 * 4, 100 + 2 * 4)); } TEST(TUtility, borderImage) { QPixmap pixmap(100, 100); pixmap.fill(Qt::red); QImage image = Utility::borderImage(pixmap, QMargins(4, 4, 4, 4), QSize(200, 200)); ASSERT_FALSE(image.isNull()); ASSERT_TRUE(image.size() == QSize(200, 200)); } TEST(TUtility, sudokuByRect) { QRect rect(0, 0, 100, 100); QMargins margins(4, 4, 4, 4); auto rects = Utility::sudokuByRect(rect, margins); ASSERT_TRUE(rects.size() == 9); ASSERT_TRUE(rects[0] == QRect(0, 0, 4, 4)); ASSERT_TRUE(rects[8] == QRect(96, 96, 4, 4)); } TEST(TUtility, internAtom) { xcb_atom_t atom = Utility::internAtom(""); ASSERT_TRUE(atom == XCB_NONE); atom = Utility::internAtom("test"); ASSERT_TRUE(atom == XCB_NONE); atom = Utility::internAtom(QX11Info::connection(), "test"); ASSERT_TRUE(atom == XCB_NONE); } qt5platform-plugins-5.7.12/tests/test-recoverage.sh000077500000000000000000000017701476226662200223650ustar00rootroot00000000000000#!/bin/bash # SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later TESTS_TARGET=ut-platformplugins filter_files=( "QtCore/*" "QtGui/*" ) SHELL_FOLDER=$(dirname $(readlink -f "$0")) # project directroy SOURCE_DIR=${SHELL_FOLDER}/../ BUILD_DIR=${SOURCE_DIR}/build TESTS_BUILD_DIR=${BUILD_DIR}/tests HTML_DIR=${TESTS_BUILD_DIR}/html export ASAN_OPTIONS="halt_on_error=0" cd ${SOURCE_DIR} cmake -B${BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -GNinja -DENABLE_COV=ON cmake --build ${BUILD_DIR} --target ${TESTS_TARGET} cd ${BUILD_DIR} ${TESTS_BUILD_DIR}/${TESTS_TARGET} lcov -d ./ -c -o coverage_all.info lcov --remove coverage_all.info "*/tests/*" "/usr/include*" "*build/*" ${filter_files[*]} --output-file coverage.info cd ${BUILD_DIR} genhtml -o ${HTML_DIR} ${BUILD_DIR}/coverage.info && ln -sf ${HTML_DIR}/index.html ${BUILD_DIR}/cov_index.html test -e ${TESTS_BUILD_DIR}/asan.log* && mv ${TESTS_BUILD_DIR}/asan.log* ${BUILD_DIR}/asan_index.log qt5platform-plugins-5.7.12/tests/test.h000066400000000000000000000005041476226662200200510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef TEST_H #define TEST_H #include class DTest : public ::testing::Test { }; template class DTestWithParam : public ::testing::TestWithParam { }; #endif // TEST_H qt5platform-plugins-5.7.12/toolGenerate/000077500000000000000000000000001476226662200202105ustar00rootroot00000000000000qt5platform-plugins-5.7.12/toolGenerate/qdbusxml2cpp/000077500000000000000000000000001476226662200226345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/toolGenerate/qdbusxml2cpp/com.deepin.imAdaptor.cpp000066400000000000000000000035361476226662200273070ustar00rootroot00000000000000/* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp ./qt5platform-plugins/misc/com.deepin.im.xml -a ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.imAdaptor -i ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.im.h * * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #include "./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.imAdaptor.h" #include #include #include #include #include #include #include /* * Implementation of adaptor class ImAdaptor */ ImAdaptor::ImAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } ImAdaptor::~ImAdaptor() { // destructor } QRect ImAdaptor::geometry() const { // get the value of property geometry return qvariant_cast< QRect >(parent()->property("geometry")); } bool ImAdaptor::imActive() const { // get the value of property imActive return qvariant_cast< bool >(parent()->property("imActive")); } void ImAdaptor::setImActive(bool value) { // set the value of property imActive parent()->setProperty("imActive", QVariant::fromValue(value)); } bool ImAdaptor::imSignalLock() const { // get the value of property imSignalLock return qvariant_cast< bool >(parent()->property("imSignalLock")); } void ImAdaptor::setImSignalLock(bool value) { // set the value of property imSignalLock parent()->setProperty("imSignalLock", QVariant::fromValue(value)); } void ImAdaptor::setKeyboardHeight(int h) { // handle method call com.deepin.im.setKeyboardHeight QMetaObject::invokeMethod(parent(), "setKeyboardHeight", Q_ARG(int, h)); } qt5platform-plugins-5.7.12/toolGenerate/qdbusxml2cpp/com.deepin.imAdaptor.h000066400000000000000000000051341476226662200267500ustar00rootroot00000000000000/* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp ./qt5platform-plugins/misc/com.deepin.im.xml -a ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.imAdaptor -i ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.im.h * * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #ifndef COM_DEEPIN_IMADAPTOR_H #define COM_DEEPIN_IMADAPTOR_H #include #include #include "./qt5platform-plugins/toolGenerate/qdbusxml2cpp/com.deepin.im.h" QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; QT_END_NAMESPACE /* * Adaptor class for interface com.deepin.im */ class ImAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.deepin.im") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: ImAdaptor(QObject *parent); virtual ~ImAdaptor(); public: // PROPERTIES Q_PROPERTY(QRect geometry READ geometry) QRect geometry() const; Q_PROPERTY(bool imActive READ imActive WRITE setImActive) bool imActive() const; void setImActive(bool value); Q_PROPERTY(bool imSignalLock READ imSignalLock WRITE setImSignalLock) bool imSignalLock() const; void setImSignalLock(bool value); public Q_SLOTS: // METHODS void setKeyboardHeight(int h); Q_SIGNALS: // SIGNALS void geometryChanged(const QRect &rect); void imActiveChanged(bool is); void imSignalLockChanged(bool is); }; #endif qt5platform-plugins-5.7.12/toolGenerate/qdbusxml2cpp/org.freedesktop.DBusAdaptor.cpp000066400000000000000000000121421476226662200306100ustar00rootroot00000000000000/* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp ./qt5platform-plugins/misc/org.freedesktop.DBus.xml -a ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBusAdaptor -i ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBus.h * * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #include "./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBusAdaptor.h" #include #include #include #include #include #include #include /* * Implementation of adaptor class DBusAdaptor */ DBusAdaptor::DBusAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } DBusAdaptor::~DBusAdaptor() { // destructor } void DBusAdaptor::AddMatch(const QString &in0) { // handle method call org.freedesktop.DBus.AddMatch QMetaObject::invokeMethod(parent(), "AddMatch", Q_ARG(QString, in0)); } QByteArray DBusAdaptor::GetAdtAuditSessionData(const QString &in0) { // handle method call org.freedesktop.DBus.GetAdtAuditSessionData QByteArray out0; QMetaObject::invokeMethod(parent(), "GetAdtAuditSessionData", Q_RETURN_ARG(QByteArray, out0), Q_ARG(QString, in0)); return out0; } QByteArray DBusAdaptor::GetConnectionSELinuxSecurityContext(const QString &in0) { // handle method call org.freedesktop.DBus.GetConnectionSELinuxSecurityContext QByteArray out0; QMetaObject::invokeMethod(parent(), "GetConnectionSELinuxSecurityContext", Q_RETURN_ARG(QByteArray, out0), Q_ARG(QString, in0)); return out0; } uint DBusAdaptor::GetConnectionUnixProcessID(const QString &in0) { // handle method call org.freedesktop.DBus.GetConnectionUnixProcessID uint out0; QMetaObject::invokeMethod(parent(), "GetConnectionUnixProcessID", Q_RETURN_ARG(uint, out0), Q_ARG(QString, in0)); return out0; } uint DBusAdaptor::GetConnectionUnixUser(const QString &in0) { // handle method call org.freedesktop.DBus.GetConnectionUnixUser uint out0; QMetaObject::invokeMethod(parent(), "GetConnectionUnixUser", Q_RETURN_ARG(uint, out0), Q_ARG(QString, in0)); return out0; } QString DBusAdaptor::GetId() { // handle method call org.freedesktop.DBus.GetId QString out0; QMetaObject::invokeMethod(parent(), "GetId", Q_RETURN_ARG(QString, out0)); return out0; } QString DBusAdaptor::GetNameOwner(const QString &in0) { // handle method call org.freedesktop.DBus.GetNameOwner QString out0; QMetaObject::invokeMethod(parent(), "GetNameOwner", Q_RETURN_ARG(QString, out0), Q_ARG(QString, in0)); return out0; } QString DBusAdaptor::Hello() { // handle method call org.freedesktop.DBus.Hello QString out0; QMetaObject::invokeMethod(parent(), "Hello", Q_RETURN_ARG(QString, out0)); return out0; } QStringList DBusAdaptor::ListActivatableNames() { // handle method call org.freedesktop.DBus.ListActivatableNames QStringList out0; QMetaObject::invokeMethod(parent(), "ListActivatableNames", Q_RETURN_ARG(QStringList, out0)); return out0; } QStringList DBusAdaptor::ListNames() { // handle method call org.freedesktop.DBus.ListNames QStringList out0; QMetaObject::invokeMethod(parent(), "ListNames", Q_RETURN_ARG(QStringList, out0)); return out0; } QStringList DBusAdaptor::ListQueuedOwners(const QString &in0) { // handle method call org.freedesktop.DBus.ListQueuedOwners QStringList out0; QMetaObject::invokeMethod(parent(), "ListQueuedOwners", Q_RETURN_ARG(QStringList, out0), Q_ARG(QString, in0)); return out0; } bool DBusAdaptor::NameHasOwner(const QString &in0) { // handle method call org.freedesktop.DBus.NameHasOwner bool out0; QMetaObject::invokeMethod(parent(), "NameHasOwner", Q_RETURN_ARG(bool, out0), Q_ARG(QString, in0)); return out0; } uint DBusAdaptor::ReleaseName(const QString &in0) { // handle method call org.freedesktop.DBus.ReleaseName uint out0; QMetaObject::invokeMethod(parent(), "ReleaseName", Q_RETURN_ARG(uint, out0), Q_ARG(QString, in0)); return out0; } void DBusAdaptor::ReloadConfig() { // handle method call org.freedesktop.DBus.ReloadConfig QMetaObject::invokeMethod(parent(), "ReloadConfig"); } void DBusAdaptor::RemoveMatch(const QString &in0) { // handle method call org.freedesktop.DBus.RemoveMatch QMetaObject::invokeMethod(parent(), "RemoveMatch", Q_ARG(QString, in0)); } uint DBusAdaptor::RequestName(const QString &in0, uint in1) { // handle method call org.freedesktop.DBus.RequestName uint out0; QMetaObject::invokeMethod(parent(), "RequestName", Q_RETURN_ARG(uint, out0), Q_ARG(QString, in0), Q_ARG(uint, in1)); return out0; } uint DBusAdaptor::StartServiceByName(const QString &in0, uint in1) { // handle method call org.freedesktop.DBus.StartServiceByName uint out0; QMetaObject::invokeMethod(parent(), "StartServiceByName", Q_RETURN_ARG(uint, out0), Q_ARG(QString, in0), Q_ARG(uint, in1)); return out0; } qt5platform-plugins-5.7.12/toolGenerate/qdbusxml2cpp/org.freedesktop.DBusAdaptor.h000066400000000000000000000113701476226662200302570ustar00rootroot00000000000000/* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: qdbusxml2cpp ./qt5platform-plugins/misc/org.freedesktop.DBus.xml -a ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBusAdaptor -i ./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBus.h * * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #ifndef ORG_FREEDESKTOP_DBUSADAPTOR_H #define ORG_FREEDESKTOP_DBUSADAPTOR_H #include #include #include "./qt5platform-plugins/toolGenerate/qdbusxml2cpp/org.freedesktop.DBus.h" QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; QT_END_NAMESPACE /* * Adaptor class for interface org.freedesktop.DBus */ class DBusAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.freedesktop.DBus") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: DBusAdaptor(QObject *parent); virtual ~DBusAdaptor(); public: // PROPERTIES public Q_SLOTS: // METHODS void AddMatch(const QString &in0); QByteArray GetAdtAuditSessionData(const QString &in0); QByteArray GetConnectionSELinuxSecurityContext(const QString &in0); uint GetConnectionUnixProcessID(const QString &in0); uint GetConnectionUnixUser(const QString &in0); QString GetId(); QString GetNameOwner(const QString &in0); QString Hello(); QStringList ListActivatableNames(); QStringList ListNames(); QStringList ListQueuedOwners(const QString &in0); bool NameHasOwner(const QString &in0); uint ReleaseName(const QString &in0); void ReloadConfig(); void RemoveMatch(const QString &in0); uint RequestName(const QString &in0, uint in1); uint StartServiceByName(const QString &in0, uint in1); Q_SIGNALS: // SIGNALS void NameAcquired(const QString &in0); void NameLost(const QString &in0); void NameOwnerChanged(const QString &in0, const QString &in1, const QString &in2); }; #endif qt5platform-plugins-5.7.12/wayland/000077500000000000000000000000001476226662200172175ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/CMakeLists.txt000066400000000000000000000002621476226662200217570ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later add_subdirectory(dwayland) add_subdirectory(wayland-shell) qt5platform-plugins-5.7.12/wayland/README.md000066400000000000000000000000251476226662200204730ustar00rootroot00000000000000# DDE Wayland plugin qt5platform-plugins-5.7.12/wayland/dwayland/000077500000000000000000000000001476226662200210225ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/dwayland/CMakeLists.txt000066400000000000000000000034021476226662200235610ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later project(dwayland) find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui WaylandClient) if(${QT_VERSION_MAJOR} STREQUAL "5") find_package(Qt5 REQUIRED COMPONENTS XkbCommonSupport) endif() find_package(PkgConfig REQUIRED) pkg_check_modules(WAYLAND REQUIRED wayland-client wayland-cursor IMPORTED_TARGET) pkg_check_modules(X11 REQUIRED xkbcommon IMPORTED_TARGET) add_definitions(-DQT5DWAYLANDPLUGIN_LIBRARY -DQT_DEPRECATED_WARNINGS) include(${CMAKE_CURRENT_LIST_DIR}/dwayland.cmake) add_library(${PROJECT_NAME} MODULE main.cpp ${wayland_SRC}) target_compile_definitions(${PROJECT_NAME} PRIVATE QT5DWAYLANDPLUGIN_LIBRARY QT_DEPRECATED_WARNINGS ) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src ) if("${QT_VERSION_MAJOR}" STREQUAL "6") list(GET Qt6WaylandClient_PRIVATE_INCLUDE_DIRS 0 dir) if(EXISTS ${dir}) target_include_directories(${PROJECT_NAME} PRIVATE ${Qt6WaylandClient_PRIVATE_INCLUDE_DIRS}) else() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/wayland/qtwayland-dev/${Qt6_VERSION}) endif() endif() target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::WaylandClient PkgConfig::WAYLAND PkgConfig::X11 ) if(${QT_VERSION_MAJOR} STREQUAL "5") target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::XkbCommonSupportPrivate Qt5::WaylandClientPrivate) endif() if(NOT INSTALL_PATH) set(INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins/platforms) endif() install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_PATH}) qt5platform-plugins-5.7.12/wayland/dwayland/dhighdpi.cpp000077500000000000000000000125331476226662200233150ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dhighdpi.h" #include "vtablehook.h" #include "dxsettings.h" #include "dwaylandinterfacehook.h" #include #include #include #include #include #include #include #ifndef QT_DEBUG Q_LOGGING_CATEGORY(dwhdpi, "dtk.wayland.plugin.hdpi" , QtInfoMsg); #else Q_LOGGING_CATEGORY(dwhdpi, "dtk.wayland.plugin.hdpi"); #endif DPP_BEGIN_NAMESPACE bool DHighDpi::active = false; QDpi DHighDpi::oldDpi = QDpi(0.0, 0.0); #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) QHash DHighDpi::screenFactorMap; #endif QPointF DHighDpi::fromNativePixels(const QPointF &pixelPoint, const QWindow *window) { return QHighDpi::fromNativePixels(pixelPoint, window); } __attribute__((constructor)) // 在库被加载时就执行此函数 static void init() { DHighDpi::init(); } void DHighDpi::init() { if (QGuiApplication::testAttribute(Qt::AA_DisableHighDpiScaling) // 可以禁用此行为 || qEnvironmentVariableIsSet("D_DXCB_DISABLE_OVERRIDE_HIDPI") // 无有效的xsettings时禁用 || !dXSettings->getOwner() || (qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY") && qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY") != "PassThrough")) { return; } // 禁用platform theme中的缩放机制 qputenv("D_DISABLE_RT_SCREEN_SCALE", "1"); // 设置为完全控制缩放比例,避免被Qt“4舍5入”了缩放比 qputenv("QT_SCALE_FACTOR_ROUNDING_POLICY", "PassThrough"); // 强制开启使用DXCB的缩放机制,此时移除会影响此功能的所有Qt环境变量 qputenv("D_DXCB_FORCE_OVERRIDE_HIDPI", "1"); if (qEnvironmentVariableIsSet("D_DXCB_FORCE_OVERRIDE_HIDPI")) { qunsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); qunsetenv("QT_SCALE_FACTOR"); qunsetenv("QT_SCREEN_SCALE_FACTORS"); qunsetenv("QT_ENABLE_HIGHDPI_SCALING"); qunsetenv("QT_USE_PHYSICAL_DPI"); } if (!QGuiApplication::testAttribute(Qt::AA_EnableHighDpiScaling)) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QHighDpiScaling::initHighDpiScaling(); } //qDebug()<QtWaylandClient::QWaylandScreen::logicalDpi(); } int dpi = 0; QVariant value = dXSettings->globalSettings()->setting("Qt/DPI/" + s->name().toLocal8Bit()); bool ok = false; dpi = value.toInt(&ok); // fallback if (!ok) { value = dXSettings->globalSettings()->setting("Xft/DPI"); dpi = value.toInt(&ok); } // fallback if (!ok || dpi == 0) { qWarning() << "dpi is invalid got from xsettings(Qt/DPI/ and Xft/DPI), " "fallback to get dpi from QWaylandScreen::logicalDpi()"; return s->QtWaylandClient::QWaylandScreen::logicalDpi(); } qreal d = dpi / 1024.0; #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) if (!screenFactorMap.contains(s)) { qDebug(dwhdpi()) << "add screen to cache" << s->model() << s->devicePixelRatio(); screenFactorMap[s] = d; } #endif #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // QWaylandScreen 没有实现 pixelDensity,为了不影响兼容性,不能采用 hook pixelDensity 的方式 QHighDpiScaling::setScreenFactor(s->screen(), d / 96.0); #endif return QDpi(d, d); } qreal DHighDpi::devicePixelRatio(QPlatformWindow *w) { qreal base_factor = QHighDpiScaling::factor(w->screen()); return qCeil(base_factor) / base_factor; } void DHighDpi::removeScreenFactorCache(QScreen *screen) { // 清理过期的屏幕缩放值 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) if (screen) { qCDebug(dwhdpi()) << "remove screen from cache" << screen->model() << screen->devicePixelRatio(); screenFactorMap.remove(screen->handle()); } else { screenFactorMap.clear(); #else { #endif // 刷新所有窗口 for (QWindow *window : qGuiApp->allWindows()) { if (window->type() == Qt::Desktop) continue; // qDebug()<devicePixelRatio(); // 更新窗口大小 if (window->handle()) { QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window)); QGuiApplicationPrivate::processGeometryChangeEvent(&gce); } } } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/wayland/dwayland/dhighdpi.h000077500000000000000000000021511476226662200227550ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DHIGHDPI_H #define DHIGHDPI_H #include "global.h" #include #include #include #include QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; namespace QtWaylandClient { class QWaylandScreen; } QT_END_NAMESPACE typedef struct xcb_connection_t xcb_connection_t; DPP_BEGIN_NAMESPACE class HighDpiImage; class DHighDpi { public: static QPointF fromNativePixels(const QPointF &pixelPoint, const QWindow *window); static void init(); static bool isActive(); static bool overrideBackingStore(); static QDpi logicalDpi(QtWaylandClient::QWaylandScreen *s); static qreal devicePixelRatio(QPlatformWindow *w); static void removeScreenFactorCache(QScreen *screen); private: static bool active; static QDpi oldDpi; #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) static QHash screenFactorMap; #endif }; DPP_END_NAMESPACE #endif // DHIGHDPI_H qt5platform-plugins-5.7.12/wayland/dwayland/dnotitlebarwindowhelper_wl.cpp000066400000000000000000000166111476226662200271740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dnotitlebarwindowhelper_wl.h" #include "vtablehook.h" #define protected public #include #undef protected #include #include #include #include #include #include #include #include #define private public #include "QtWaylandClient/private/qwaylandintegration_p.h" #include "QtWaylandClient/private/qwaylandshellsurface_p.h" #include "QtWaylandClient/private/qwaylandwindow_p.h" #include "QtWaylandClient/private/qwaylandcursor_p.h" #undef private #include DPP_BEGIN_NAMESPACE QHash DNoTitlebarWlWindowHelper::mapped; DNoTitlebarWlWindowHelper::DNoTitlebarWlWindowHelper(QWindow *window) : QObject(window) , m_window(window) { // 不允许设置窗口为无边框的 if (window->flags().testFlag(Qt::FramelessWindowHint)) { window->setFlag(Qt::FramelessWindowHint, false); } mapped[window] = this; updateEnableSystemMoveFromProperty(); } DNoTitlebarWlWindowHelper::~DNoTitlebarWlWindowHelper() { if (VtableHook::hasVtable(m_window)) { VtableHook::resetVtable(m_window); } mapped.remove(static_cast(parent())); // TODO // if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性 // //! Utility::clearWindowProperty(m_windowID, Utility::internAtom(_DEEPIN_SCISSOR_WINDOW)); // DPlatformIntegration::clearNativeSettings(m_windowID); // } } void DNoTitlebarWlWindowHelper::setWindowProperty(QWindow *window, const char *name, const QVariant &value) { const QVariant &old_value = window->property(name); if (old_value.isValid() && old_value == value) return; if (value.typeName() == QByteArray("QPainterPath")) { const QPainterPath &old_path = qvariant_cast(old_value); const QPainterPath &new_path = qvariant_cast(value); if (old_path == new_path) { return; } } if(!window) return; window->setProperty(name, value); if(window->handle()) { QtWaylandClient::QWaylandWindow *wl_window = static_cast(window->handle()); if (wl_window->shellSurface()) wl_window->sendProperty(name, value); } if (DNoTitlebarWlWindowHelper *self = mapped.value(window)) { QByteArray name_array(name); if (!name_array.startsWith("_d_")) return; // to upper name_array[3] = name_array.at(3) & ~0x20; const QByteArray slot_name = "update" + name_array.mid(3) + "FromProperty"; if (self->metaObject()->indexOfSlot(slot_name + QByteArray("()")) < 0) return; if (!QMetaObject::invokeMethod(self, slot_name.constData(), Qt::DirectConnection)) { qWarning() << "Failed to update property:" << slot_name; } } } void DNoTitlebarWlWindowHelper::requestByWindowProperty(QWindow *window, const char *name) { if (window && window->handle()) { QtWaylandClient::QWaylandWindow *wl_window = static_cast(window->handle()); if (wl_window && wl_window->shellSurface()) wl_window->sendProperty(name, QVariant()); } } void DNoTitlebarWlWindowHelper::popupSystemWindowMenu(quintptr wid) { QWindow *window = fromQtWinId(wid); if(!window || !window->handle()) return; QtWaylandClient::QWaylandWindow *wl_window = static_cast(window->handle()); if (!wl_window->shellSurface()) return; if (QtWaylandClient::QWaylandShellSurface *s = wl_window->shellSurface()) { auto wl_integration = static_cast(QGuiApplicationPrivate::platformIntegration()); s->showWindowMenu(wl_integration->display()->defaultInputDevice()); } } void DNoTitlebarWlWindowHelper::updateEnableSystemMoveFromProperty() { const QVariant &v = m_window->property(enableSystemMove); m_enableSystemMove = !v.isValid() || v.toBool(); if (m_enableSystemMove) { HookOverride(m_window, &QWindow::event, &DNoTitlebarWlWindowHelper::windowEvent); } else if (VtableHook::hasVtable(m_window)) { HookReset(m_window, &QWindow::event); } } bool DNoTitlebarWlWindowHelper::windowEvent(QWindow *w, QEvent *event) { DNoTitlebarWlWindowHelper *self = mapped.value(w); if (!self) return VtableHook::callOriginalFun(w, &QWindow::event, event); // m_window 的 event 被 override 以后,在 windowEvent 里面获取到的 this 就成 m_window 了, // 而不是 DNoTitlebarWlWindowHelper,所以此处 windowEvent 改为 static 并传 self 进来 { // get touch begin position static bool isTouchDown = false; static QPointF touchBeginPosition; if (event->type() == QEvent::TouchBegin) { isTouchDown = true; } if (event->type() == QEvent::TouchEnd || event->type() == QEvent::MouseButtonRelease) { isTouchDown = false; } if (isTouchDown && event->type() == QEvent::MouseButtonPress) { touchBeginPosition = static_cast(event)->globalPos(); } // add some redundancy to distinguish trigger between system menu and system move if (event->type() == QEvent::MouseMove) { QPointF currentPos = static_cast(event)->globalPos(); QPointF delta = touchBeginPosition - currentPos; if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { return VtableHook::callOriginalFun(w, &QWindow::event, event); } } } bool is_mouse_move = event->type() == QEvent::MouseMove && static_cast(event)->buttons() == Qt::LeftButton; if (event->type() == QEvent::MouseButtonRelease) { self->m_windowMoving = false; } if (!HookCall(w, &QWindow::event, event)) return false; // workaround for kwin: Qt receives no release event when kwin finishes MOVE operation, // which makes app hang in windowMoving state. when a press happens, there's no sense of // keeping the moving state, we can just reset ti back to normal. if (event->type() == QEvent::MouseButtonPress) { self->m_windowMoving = false; } if (is_mouse_move && !event->isAccepted() && w->geometry().contains(static_cast(event)->globalPos())) { if (!self->m_windowMoving && self->isEnableSystemMove()) { self->m_windowMoving = true; event->accept(); startMoveWindow(w); } } return true; } bool DNoTitlebarWlWindowHelper::isEnableSystemMove(/*quint32 winId*/) { return m_enableSystemMove; } void DNoTitlebarWlWindowHelper::startMoveWindow(QWindow *window) { // QWaylandWindow::startSystemMove if (window && window->handle()) { #if QTWAYLANDCLIENT_VERSION < QT_VERSION_CHECK(5, 15, 0) static_cast(window->handle())->startSystemMove(QCursor::pos()); #else static_cast(window->handle())->startSystemMove(); #endif } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/wayland/dwayland/dnotitlebarwindowhelper_wl.h000066400000000000000000000024101476226662200266310ustar00rootroot00000000000000// SPDX-FileCopyrightText: 0217 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DNOTITLEBARWINDOWHELPER_WL_H #define DNOTITLEBARWINDOWHELPER_WL_H #include "global.h" #include #include QT_BEGIN_NAMESPACE class QWindow; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DNativeSettings; class DNoTitlebarWlWindowHelper : public QObject { Q_OBJECT public: explicit DNoTitlebarWlWindowHelper(QWindow *window); ~DNoTitlebarWlWindowHelper(); static void setWindowProperty(QWindow *window, const char *name, const QVariant &value); static void requestByWindowProperty(QWindow *window, const char *name); static void popupSystemWindowMenu(quintptr wid); private slots: // update properties Q_SLOT void updateEnableSystemMoveFromProperty(); private: static bool windowEvent(QWindow *w, QEvent *event); bool isEnableSystemMove(); static void startMoveWindow(QWindow *window); private: QWindow *m_window; bool m_windowMoving = false; // properties bool m_enableSystemMove = true; public: static QHash mapped; }; DPP_END_NAMESPACE Q_DECLARE_METATYPE(QPainterPath) #endif // DNOTITLEBARWINDOWHELPER_WL_H qt5platform-plugins-5.7.12/wayland/dwayland/dwayland.cmake000066400000000000000000000013201476226662200236230ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later file(GLOB WAYLAND_HEADER ${CMAKE_CURRENT_LIST_DIR}/*.h ${CMAKE_SOURCE_DIR}/src/global.h ${CMAKE_SOURCE_DIR}/src/vtablehook.h ${CMAKE_SOURCE_DIR}/src/dxcbxsettings.h ${CMAKE_SOURCE_DIR}/src/dplatformsettings.h ${CMAKE_SOURCE_DIR}/src/dnativesettings.h ) file(GLOB WAYLAND_SOURCE ${CMAKE_CURRENT_LIST_DIR}/*.cpp ${CMAKE_SOURCE_DIR}/src/global.cpp ${CMAKE_SOURCE_DIR}/src/vtablehook.cpp ${CMAKE_SOURCE_DIR}/src/dxcbxsettings.cpp ${CMAKE_SOURCE_DIR}/src/dplatformsettings.cpp ${CMAKE_SOURCE_DIR}/src/dnativesettings.cpp ) set(wayland_SRC ${WAYLAND_HEADER} ${WAYLAND_SOURCE} ) qt5platform-plugins-5.7.12/wayland/dwayland/dwayland.json000066400000000000000000000000511476226662200235140ustar00rootroot00000000000000{ "Keys":[ "wayland", "dwayland" ] } qt5platform-plugins-5.7.12/wayland/dwayland/dwaylandintegration.cpp000066400000000000000000000251021476226662200255750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dwaylandintegration.h" #include "dwaylandinterfacehook.h" #include "vtablehook.h" #include "dxsettings.h" #include #define private public #include #include #include #include #undef private #include #include #include #include #include DPP_BEGIN_NAMESPACE #define XSETTINGS_DOUBLE_CLICK_TIME QByteArrayLiteral("Net/DoubleClickTime") #define XSETTINGS_CURSOR_THEME_NAME QByteArrayLiteral("Gtk/CursorThemeName") #define XSETTINGS_PRIMARY_MONITOR_RECT QByteArrayLiteral("DDE/PrimaryMonitorRect") enum XSettingType:quint64 { Gtk_CursorThemeName, Dde_PrimaryMonitorRect }; static void overrideChangeCursor(QPlatformCursor *cursorHandle, QCursor * cursor, QWindow * widget) { if (!(widget && widget->handle())) return; if (widget->property(disableOverrideCursor).toBool()) return; // qtwayland里面判断了,如果没有设置环境变量,就用默认大小32, 这里通过设在环境变量将大小设置我们需要的24 static bool xcursorSizeIsSet = qEnvironmentVariableIsSet("XCURSOR_SIZE"); if (!xcursorSizeIsSet) { qputenv("XCURSOR_SIZE", QByteArray::number(24 * qApp->devicePixelRatio())); } HookCall(cursorHandle, &QPlatformCursor::changeCursor, cursor, widget); // 调用changeCursor后,控制中心窗口的光标没有及时更新,这里强制刷新一下 for (auto *inputDevice : DWaylandIntegration::instance()->display()->inputDevices()) { if (inputDevice->pointer()) { inputDevice->pointer()->updateCursor(); } } } static void onXSettingsChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle) { Q_UNUSED(connection) Q_UNUSED(property) Q_UNUSED(name) quint64 type = reinterpret_cast(handle); switch (type) { case Gtk_CursorThemeName: const QByteArray &cursor_name = dXSettings->globalSettings()->setting(name).toByteArray(); #if QTWAYLANDCLIENT_VERSION < QT_VERSION_CHECK(5, 13, 0) const auto &cursor_map = DWaylandIntegration::instance()->display()->mCursorThemesBySize; #elif QTWAYLANDCLIENT_VERSION < QT_VERSION_CHECK(5, 16, 0) const auto &cursor_map = DWaylandIntegration::instance()->display()->mCursorThemes; #endif // 处理光标主题变化 for (auto cursor = cursor_map.constBegin(); cursor != cursor_map.constEnd(); ++cursor) { QtWaylandClient::QWaylandCursorTheme *ct = cursor.value(); // 根据大小记载新的主题 #if QTWAYLANDCLIENT_VERSION < QT_VERSION_CHECK(5, 13, 0) auto theme = wl_cursor_theme_load(cursor_name.constData(), cursor.key(), DWaylandIntegration::instance()->display()->shm()->object()); #elif QTWAYLANDCLIENT_VERSION < QT_VERSION_CHECK(5, 16, 0) auto theme = wl_cursor_theme_load(cursor_name.constData(), cursor.key().second, DWaylandIntegration::instance()->display()->shm()->object()); #endif // 如果新主题创建失败则不更新数据 if (!theme) continue; // 先尝试销毁旧主题 if (ct->m_theme) { wl_cursor_theme_destroy(ct->m_theme); } // 清理缓存数据 ct->m_cursors.clear(); ct->m_theme = theme; } // 更新窗口光标 for (auto s : DWaylandIntegration::instance()->display()->screens()) { for (QWindow *w : s->windows()) { QCursor cursor = w->cursor(); // 为窗口重新设置光标 s->cursor()->changeCursor(&cursor, w); } } break; } } static void onPrimaryRectChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle) { Q_UNUSED(connection) Q_UNUSED(property) quint64 type = reinterpret_cast(handle); switch (type) { case Dde_PrimaryMonitorRect: { auto screens = DWaylandIntegration::instance()->display()->screens(); const QString &primaryScreenRect = dXSettings->globalSettings()->setting(name).toString(); auto list = primaryScreenRect.split('-'); if (list.size() != 4) return; QRect xsettingsRect(list.at(0).toInt(), list.at(1).toInt(), list.at(2).toInt(), list.at(3).toInt()); qDebug() << "primary rect from xsettings:" << primaryScreenRect << ", key:" << name; for (auto s : screens) { qDebug() << "screen info:" << s->screen()->name() << s->screen()->model() << s->screen()->geometry() << s->geometry() << s->name() << s->model() << s->screen()->geometry() << s->geometry(); } // 设置新的主屏 QtWaylandClient::QWaylandScreen *primaryScreen = nullptr; // 坐标一致,认定为主屏 for (auto screen : screens) { if (screen->geometry().topLeft() == xsettingsRect.topLeft() && screen->screen() != qApp->primaryScreen()) { primaryScreen = screen; qDebug() << "got primary:" << primaryScreen->name() << primaryScreen->geometry(); break; } } if (primaryScreen) { #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) QWindowSystemInterface::handlePrimaryScreenChanged(primaryScreen); #else DWaylandIntegration::instance()->setPrimaryScreen(primaryScreen); #endif } break; } default: break; } qDebug() << "primary screen info:" << QGuiApplication::primaryScreen()->name() << QGuiApplication::primaryScreen()->model() << QGuiApplication::primaryScreen()->geometry(); } DWaylandIntegration::DWaylandIntegration() { dXSettings->initXcbConnection(); } void DWaylandIntegration::initialize() { // 由于Qt代码中可能写死了判断是不是wayland平台,所以只能伪装成是wayland if (qgetenv("DXCB_FAKE_PLATFORM_NAME_XCB") != "0") { *QGuiApplicationPrivate::platform_name = "wayland"; } qApp->setProperty("_d_isDwayland", true); QWaylandIntegration::initialize(); // 覆盖wayland的平台函数接口,用于向上层返回一些必要的与平台相关的函数供其使用 HookOverride(nativeInterface(), &QPlatformNativeInterface::platformFunction, &DWaylandInterfaceHook::platformFunction); // hook qtwayland的改变光标的函数,用于设置环境变量并及时更新 for (QScreen *screen : qApp->screens()) { //在没有屏幕的时候,qtwayland会创建一个虚拟屏幕,此时不能调用screen->handle()->cursor() if (screen && screen->handle() && screen->handle()->cursor()) { HookOverride(screen->handle()->cursor(), &QPlatformCursor::changeCursor, &overrideChangeCursor); } } // 监听xsettings的信号,用于更新程序状态(如更新光标主题) dXSettings->globalSettings()->registerCallbackForProperty(XSETTINGS_CURSOR_THEME_NAME, onXSettingsChanged, reinterpret_cast(XSettingType::Gtk_CursorThemeName)); // 增加rect的属性,保存主屏的具体坐标,不依靠其name判断(根据name查找对应的屏幕时概率性出错,根据主屏的rect确定哪一个QScreen才是主屏) dXSettings->globalSettings()->registerCallbackForProperty(XSETTINGS_PRIMARY_MONITOR_RECT, onPrimaryRectChanged, reinterpret_cast(XSettingType::Dde_PrimaryMonitorRect)); //初始化时应该设一次主屏,防止应用启动时主屏闪变 onPrimaryRectChanged(nullptr, XSETTINGS_PRIMARY_MONITOR_RECT, QVariant(), reinterpret_cast(XSettingType::Dde_PrimaryMonitorRect)); QTimer *m_delayTimer = new QTimer; m_delayTimer->setInterval(10); m_delayTimer->setSingleShot(true); QObject::connect(qApp, &QGuiApplication::aboutToQuit, m_delayTimer, &QObject::deleteLater); QObject::connect(m_delayTimer, &QTimer::timeout, []{ onPrimaryRectChanged(nullptr, XSETTINGS_PRIMARY_MONITOR_RECT, QVariant(), reinterpret_cast(XSettingType::Dde_PrimaryMonitorRect)); }); // 显示器信息发生变化时,刷新主屏信息 auto handleScreenInfoChanged = [ = ](QScreen *s) { #define HANDLE_SCREEN_SIGNAL(signal) \ QObject::connect(s, signal, m_delayTimer, static_cast(&QTimer::start)); HANDLE_SCREEN_SIGNAL(&QScreen::geometryChanged); HANDLE_SCREEN_SIGNAL(&QScreen::availableGeometryChanged); HANDLE_SCREEN_SIGNAL(&QScreen::physicalSizeChanged); HANDLE_SCREEN_SIGNAL(&QScreen::physicalDotsPerInchChanged); HANDLE_SCREEN_SIGNAL(&QScreen::logicalDotsPerInchChanged); HANDLE_SCREEN_SIGNAL(&QScreen::virtualGeometryChanged); HANDLE_SCREEN_SIGNAL(&QScreen::primaryOrientationChanged); HANDLE_SCREEN_SIGNAL(&QScreen::orientationChanged); HANDLE_SCREEN_SIGNAL(&QScreen::refreshRateChanged); m_delayTimer->start(); }; for (auto s : qApp->screens()) { handleScreenInfoChanged(s); } QObject::connect(qApp, &QGuiApplication::screenAdded, handleScreenInfoChanged); QObject::connect(qApp, &QGuiApplication::screenAdded, m_delayTimer, static_cast(&QTimer::start)); } QStringList DWaylandIntegration::themeNames() const { auto list = QWaylandIntegration::themeNames(); const QByteArray desktop_session = qgetenv("DESKTOP_SESSION"); // 在lightdm环境中,无此环境变量。默认使用deepin平台主题 if (desktop_session.isEmpty() || desktop_session == "deepin") list.prepend("deepin"); return list; } #define GET_VALID_XSETTINGS(key) { \ auto value = dXSettings->globalSettings()->setting(key); \ if (value.isValid()) return value; \ } QVariant DWaylandIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { #ifdef Q_OS_LINUX switch ((int)hint) { case MouseDoubleClickInterval: GET_VALID_XSETTINGS(XSETTINGS_DOUBLE_CLICK_TIME); break; case ShowShortcutsInContextMenus: return false; default: break; } #endif return QtWaylandClient::QWaylandIntegration::styleHint(hint); } #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) void DWaylandIntegration::setPrimaryScreen(QPlatformScreen *newPrimary) { return QPlatformIntegration::setPrimaryScreen(newPrimary); } #endif DPP_END_NAMESPACE qt5platform-plugins-5.7.12/wayland/dwayland/dwaylandintegration.h000066400000000000000000000015211476226662200252410ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DWAYLANDINTEGRATION_H #define DWAYLANDINTEGRATION_H #include "global.h" #include "QtWaylandClient/private/qwaylandintegration_p.h" DPP_BEGIN_NAMESPACE class DWaylandIntegration : public QtWaylandClient::QWaylandIntegration { DWaylandIntegration(); public: static DWaylandIntegration *instance() { static DWaylandIntegration *integration = new DWaylandIntegration; return integration; } void initialize() override; QStringList themeNames() const override; QVariant styleHint(StyleHint hint) const override; #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) void setPrimaryScreen(QPlatformScreen *newPrimary); #endif }; DPP_END_NAMESPACE #endif // DWAYLANDINTEGRATION_H qt5platform-plugins-5.7.12/wayland/dwayland/dwaylandinterfacehook.cpp000077500000000000000000000214371476226662200261050ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #define private public #include "QtWaylandClient/private/qwaylandnativeinterface_p.h" #undef private #include "dwaylandinterfacehook.h" #include "dhighdpi.h" #include "dxsettings.h" #include "dnotitlebarwindowhelper_wl.h" #include #include #include #include #include #ifndef QT_DEBUG Q_LOGGING_CATEGORY(dwli, "dtk.wayland.interface" , QtInfoMsg); #else Q_LOGGING_CATEGORY(dwli, "dtk.wayland.interface"); #endif DPP_BEGIN_NAMESPACE static QFunctionPointer getFunction(const QByteArray &function) { static QHash functionCache = { {buildNativeSettings, reinterpret_cast(&DWaylandInterfaceHook::buildNativeSettings)}, {clearNativeSettings, reinterpret_cast(&DWaylandInterfaceHook::clearNativeSettings)}, {setEnableNoTitlebar, reinterpret_cast(&DWaylandInterfaceHook::setEnableNoTitlebar)}, {isEnableNoTitlebar, reinterpret_cast(&DWaylandInterfaceHook::isEnableNoTitlebar)}, {setWindowRadius, reinterpret_cast(&DWaylandInterfaceHook::setWindowRadius)}, {setBorderColor, reinterpret_cast(&DWaylandInterfaceHook::setBorderColor)}, {setBorderWidth, reinterpret_cast(&DWaylandInterfaceHook::setBorderWidth)}, {setShadowColor, reinterpret_cast(&DWaylandInterfaceHook::setShadowColor)}, {setShadowOffset, reinterpret_cast(&DWaylandInterfaceHook::setShadowOffset)}, {setShadowRadius, reinterpret_cast(&DWaylandInterfaceHook::setShadowRadius)}, {setWindowEffect, reinterpret_cast(&DWaylandInterfaceHook::setWindowEffect)}, {setWindowStartUpEffect, reinterpret_cast(&DWaylandInterfaceHook::setWindowStartUpEffect)}, {setWindowProperty, reinterpret_cast(&DWaylandInterfaceHook::setWindowProperty)}, {popupSystemWindowMenu, reinterpret_cast(&DWaylandInterfaceHook::popupSystemWindowMenu)}, {enableDwayland, reinterpret_cast(&DWaylandInterfaceHook::enableDwayland)}, {isEnableDwayland, reinterpret_cast(&DWaylandInterfaceHook::isEnableDwayland)}, {splitWindowOnScreen, reinterpret_cast(&DWaylandInterfaceHook::splitWindowOnScreen)}, {supportForSplittingWindow, reinterpret_cast(&DWaylandInterfaceHook::supportForSplittingWindow)}, {splitWindowOnScreenByType, reinterpret_cast(&DWaylandInterfaceHook::splitWindowOnScreenByType)}, {supportForSplittingWindowByType, reinterpret_cast(&DWaylandInterfaceHook::supportForSplittingWindowByType)} }; return functionCache.value(function); } QFunctionPointer DWaylandInterfaceHook::platformFunction(QPlatformNativeInterface *interface, const QByteArray &function) { QFunctionPointer f = getFunction(function); #if QTWAYLANDCLIENT_VERSION >= QT_VERSION_CHECK(5, 4, 0) if (Q_UNLIKELY(!f)) { f = static_cast(interface)->QtWaylandClient::QWaylandNativeInterface::platformFunction(function); } #endif return f; } bool DWaylandInterfaceHook::buildNativeSettings(QObject *object, quint32 settingWindow) { return dXSettings->buildNativeSettings(object, settingWindow); } void DWaylandInterfaceHook::clearNativeSettings(quint32 settingWindow) { dXSettings->clearNativeSettings(settingWindow); } bool DWaylandInterfaceHook::setEnableNoTitlebar(QWindow *window, bool enable) { if (enable) { if (DNoTitlebarWlWindowHelper::mapped.value(window)) return true; if (window->type() == Qt::Desktop) return false; window->setProperty(noTitlebar, true); Q_UNUSED(new DNoTitlebarWlWindowHelper(window)) return true; } else { if (auto helper = DNoTitlebarWlWindowHelper::mapped.value(window)) { helper->deleteLater(); } window->setProperty(noTitlebar, false); } return true; } bool DWaylandInterfaceHook::isEnableNoTitlebar(QWindow *window) { return window->property(noTitlebar).toBool(); } void DWaylandInterfaceHook::setWindowRadius(QWindow *window, int value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::windowRadius, value); } void DWaylandInterfaceHook::setBorderColor(QWindow *window, const QColor &value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::borderColor, value); } void DWaylandInterfaceHook::setShadowColor(QWindow *window, const QColor &value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::shadowColor, value); } void DWaylandInterfaceHook::setShadowRadius(QWindow *window, int value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::shadowRadius, value); } void DWaylandInterfaceHook::setShadowOffset(QWindow *window, const QPoint &value) { if (!window) return; QPoint offect = value; if (window->screen()) offect *= window->screen()->devicePixelRatio(); DNoTitlebarWlWindowHelper::setWindowProperty(window, ::shadowOffset, offect); } void DWaylandInterfaceHook::setBorderWidth(QWindow *window, int value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::borderWidth, value); } void DWaylandInterfaceHook::setWindowEffect(QWindow *window, const QVariant &value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::windowEffect, value); } void DWaylandInterfaceHook::setWindowStartUpEffect(QWindow *window, const QVariant &value) { if (!window) return; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::windowStartUpEffect, value); } void DWaylandInterfaceHook::setWindowProperty(QWindow *window, const char *name, const QVariant &value) { DNoTitlebarWlWindowHelper::setWindowProperty(window, name, value); } void DWaylandInterfaceHook::popupSystemWindowMenu(WId wid) { DNoTitlebarWlWindowHelper::popupSystemWindowMenu(wid); } bool DWaylandInterfaceHook::enableDwayland(QWindow *window) { static bool xwayland = QByteArrayLiteral("wayland") == qgetenv("XDG_SESSION_TYPE") && !qEnvironmentVariableIsEmpty("WAYLAND_DISPLAY"); if (xwayland) { // for xwayland return false; } if (window->type() == Qt::Desktop) return false; QPlatformWindow *xw = static_cast(window->handle()); if (!xw) { window->setProperty(useDwayland, true); return true; } if (DNoTitlebarWlWindowHelper::mapped.value(window)) return true; if (xw->isExposed()) return false; #ifndef USE_NEW_IMPLEMENTING return false; #endif window->setProperty(useDwayland, true); // window->setProperty("_d_dwayland_TransparentBackground", window->format().hasAlpha()); return true; } bool DWaylandInterfaceHook::isEnableDwayland(const QWindow *window) { return window->property(useDwayland).toBool(); } void DWaylandInterfaceHook::splitWindowOnScreen(WId wid, quint32 type) { return splitWindowOnScreenByType(wid, 1, type); } void DWaylandInterfaceHook::splitWindowOnScreenByType(WId wid, quint32 position, quint32 type) { QWindow *window = fromQtWinId(wid); if(!window || !window->handle()) return; // position: 15 not preview if (position == 15) { if (window->windowStates().testFlag(Qt::WindowMaximized)) { window->showNormal(); } else { window->showMaximized(); } } else { // type 1:two splitting 2:three splitting 4:four splitting // position enum class SplitType in kwin-dev, Left=0x1, Right=0x10, Top=0x100, Bottom=0x1000 QVariantList value{position, type}; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::splitWindowOnScreen, value); } } bool DWaylandInterfaceHook::supportForSplittingWindow(WId wid) { return supportForSplittingWindowByType(wid, 1); } // screenSplittingType: 0: can't splitting, 1:two splitting, 2: four splitting(includ three splitting) bool DWaylandInterfaceHook::supportForSplittingWindowByType(quint32 wid, quint32 screenSplittingType) { QWindow *window = fromQtWinId(wid); if(!window || !window->handle()) return false; DNoTitlebarWlWindowHelper::setWindowProperty(window, ::supportForSplittingWindow, false); return window->property(::supportForSplittingWindow).toInt() >= screenSplittingType; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/wayland/dwayland/dwaylandinterfacehook.h000077500000000000000000000042161476226662200255460ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPLATFORMNATIVEINTERFACE_H #define DPLATFORMNATIVEINTERFACE_H #include "global.h" #include #include QT_BEGIN_NAMESPACE class QObject; class QWindow; class QPointF; class QVariant; class QPlatformNativeInterface; QT_END_NAMESPACE typedef struct xcb_connection_t xcb_connection_t; DPP_BEGIN_NAMESPACE class DXcbXSettings; class DWaylandInterfaceHook { public: static DWaylandInterfaceHook *instance() { static DWaylandInterfaceHook *hook = new DWaylandInterfaceHook; return hook; } static QFunctionPointer platformFunction(QPlatformNativeInterface *interface, const QByteArray &function); static bool buildNativeSettings(QObject *object, quint32 settingWindow); static void clearNativeSettings(quint32 settingWindow); static bool setEnableNoTitlebar(QWindow *window, bool enable); static bool isEnableNoTitlebar(QWindow *window); static void setWindowRadius(QWindow *window, int value); static void setBorderColor(QWindow *window, const QColor &value); static void setShadowColor(QWindow *window, const QColor &value); static void setShadowRadius(QWindow *window, int value); static void setShadowOffset(QWindow *window, const QPoint &value); static void setBorderWidth(QWindow *window, int value); static void setWindowEffect(QWindow *window, const QVariant &value); static void setWindowStartUpEffect(QWindow *window, const QVariant &value); static void setWindowProperty(QWindow *window, const char *name, const QVariant &value); static void popupSystemWindowMenu(quintptr wid); static bool enableDwayland(QWindow *window); static bool isEnableDwayland(const QWindow *window); static void splitWindowOnScreen(WId wid, quint32 type); static void splitWindowOnScreenByType(WId wid, quint32 position, quint32 type); static bool supportForSplittingWindow(WId wid); static bool supportForSplittingWindowByType(quint32 wid, quint32 screenSplittingType); }; DPP_END_NAMESPACE #endif // DPLATFORMNATIVEINTERFACE_H qt5platform-plugins-5.7.12/wayland/dwayland/dxsettings.cpp000066400000000000000000000060771476226662200237340ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dxsettings.h" #include DPP_BEGIN_NAMESPACE class DXcbEventFilter : public QThread { public: DXcbEventFilter(xcb_connection_t *connection) : m_connection(connection) , m_threadProxy(new RunInThreadProxy(qApp)) { QThread::start(); } void run() override { xcb_generic_event_t *event; while (m_connection && (event = xcb_wait_for_event(m_connection))) { uint response_type = event->response_type & ~0x80; switch (response_type) { case XCB_PROPERTY_NOTIFY: { m_threadProxy->proxyCall([event]() { xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event; DXcbXSettings::handlePropertyNotifyEvent(pn); }); break; } case XCB_CLIENT_MESSAGE: { m_threadProxy->proxyCall([event]() { xcb_client_message_event_t *ev = reinterpret_cast(event); DXcbXSettings::handleClientMessageEvent(ev); }); break; } } } } private: xcb_connection_t *m_connection; RunInThreadProxy *m_threadProxy = nullptr; }; xcb_connection_t *DXSettings::xcb_connection = nullptr; DXcbXSettings *DXSettings::m_xsettings = nullptr; void DXSettings::initXcbConnection() { static bool isInit = false; if (isInit && xcb_connection) { return; } isInit = true; int primary_screen_number = 0; xcb_connection = xcb_connect(qgetenv("DISPLAY"), &primary_screen_number); new DXcbEventFilter(xcb_connection); } bool DXSettings::buildNativeSettings(QObject *object, quint32 settingWindow) { QByteArray settings_property = DNativeSettings::getSettingsProperty(object); DXcbXSettings *settings = nullptr; bool global_settings = false; if (settingWindow || !settings_property.isEmpty()) { settings = new DXcbXSettings(xcb_connection, settingWindow, settings_property); } else { global_settings = true; settings = globalSettings(); } // 跟随object销毁 auto native_settings = new DNativeSettings(object, settings, global_settings); if (!native_settings->isValid()) { delete native_settings; return false; } return true; } void DXSettings::clearNativeSettings(quint32 settingWindow) { #ifdef Q_OS_LINUX DXcbXSettings::clearSettings(settingWindow); #endif } DXcbXSettings *DXSettings::globalSettings() { if (Q_LIKELY(m_xsettings)) { return m_xsettings; } if (!xcb_connection) { initXcbConnection(); } m_xsettings = new DXcbXSettings(xcb_connection); return m_xsettings; } xcb_window_t DXSettings::getOwner(xcb_connection_t *conn, int screenNumber) { return DXcbXSettings::getOwner(conn, screenNumber); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/wayland/dwayland/dxsettings.h000066400000000000000000000016341476226662200233730ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DXSETTINGS #define DXSETTINGS #include #include "dxcbxsettings.h" #include "dnativesettings.h" #include DPP_BEGIN_NAMESPACE class DXSettings { DXSettings() {} ~DXSettings() {} public: static DXSettings *instance() { static DXSettings *dxsettings = new DXSettings; return dxsettings; } void initXcbConnection(); bool buildNativeSettings(QObject *object, quint32 settingWindow); void clearNativeSettings(quint32 settingWindow); DXcbXSettings *globalSettings(); xcb_window_t getOwner(xcb_connection_t *conn = nullptr, int screenNumber = 0); private: static xcb_connection_t *xcb_connection; static DXcbXSettings *m_xsettings; }; #define dXSettings DXSettings::instance() DPP_END_NAMESPACE #endif//DXSETTINGS qt5platform-plugins-5.7.12/wayland/dwayland/main.cpp000066400000000000000000000016771476226662200224650ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "global.h" #include "dwaylandintegration.h" #include DPP_USE_NAMESPACE QT_BEGIN_NAMESPACE class DWaylandIntegrationPlugin : public QPlatformIntegrationPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "dwayland.json") public: QPlatformIntegration *create(const QString&, const QStringList&) override; }; QPlatformIntegration* DWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { #ifdef Q_OS_LINUX Q_UNUSED(system); Q_UNUSED(paramList); auto *integration = DWaylandIntegration::instance(); if (integration->hasFailed()) { delete integration; integration = nullptr; } return integration; #endif return nullptr; } QT_END_NAMESPACE #include "main.moc" qt5platform-plugins-5.7.12/wayland/qtwayland-dev/000077500000000000000000000000001476226662200217775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/000077500000000000000000000000001476226662200225245ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/000077500000000000000000000000001476226662200255675ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/000077500000000000000000000000001476226662200272415ustar00rootroot00000000000000qtwaylandclient-config.h000066400000000000000000000001671476226662200340050ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later qtwaylandclient-config_p.h000066400000000000000000000006401476226662200343200ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #define QT_FEATURE_wayland_client 1 #define QT_FEATURE_drm_egl_server 1 #define QT_FEATURE_libhybris_egl_server -1 #define QT_FEATURE_wayland_brcm -1 #define QT_FEATURE_wayland_datadevice 1 #define QT_FEATURE_wayland_egl 1 #define QT_FEATURE_xcomposite_egl 1 #define QT_FEATURE_xcomposite_glx -1 qtwaylandclientglobal.h000066400000000000000000000013661476226662200337250ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTGLOBAL_H #define QWAYLANDCLIENTGLOBAL_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE #if !defined(Q_WAYLAND_CLIENT_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_EXPORT # endif #endif QT_END_NAMESPACE #endif //QWAYLANDCLIENTGLOBAL_H qtwaylandclientglobal_p.h000066400000000000000000000011571476226662200342420ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTGLOBAL_P_H #define QWAYLANDCLIENTGLOBAL_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #endif //QWAYLANDCLIENTGLOBAL_P_H qwayland-hardware-integration.h000066400000000000000000000041731476226662200352740ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_HARDWARE_INTEGRATION #define QT_WAYLAND_HARDWARE_INTEGRATION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT qt_hardware_integration { public: qt_hardware_integration(struct ::wl_registry *registry, int id, int version); qt_hardware_integration(struct ::qt_hardware_integration *object); qt_hardware_integration(); virtual ~qt_hardware_integration(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_hardware_integration *object); struct ::qt_hardware_integration *object() { return m_qt_hardware_integration; } const struct ::qt_hardware_integration *object() const { return m_qt_hardware_integration; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void hardware_integration_client_backend(const QString &name); virtual void hardware_integration_server_backend(const QString &name); private: void init_listener(); static const struct qt_hardware_integration_listener m_qt_hardware_integration_listener; static void handle_client_backend( void *data, struct ::qt_hardware_integration *object, const char *name); static void handle_server_backend( void *data, struct ::qt_hardware_integration *object, const char *name); struct ::qt_hardware_integration *m_qt_hardware_integration; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-qt-key-unstable-v1.h000066400000000000000000000042601476226662200345240ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_QT_KEY_UNSTABLE_V1 #define QT_WAYLAND_QT_KEY_UNSTABLE_V1 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT zqt_key_v1 { public: zqt_key_v1(struct ::wl_registry *registry, int id, int version); zqt_key_v1(struct ::zqt_key_v1 *object); zqt_key_v1(); virtual ~zqt_key_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zqt_key_v1 *object); struct ::zqt_key_v1 *object() { return m_zqt_key_v1; } const struct ::zqt_key_v1 *object() const { return m_zqt_key_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void zqt_key_v1_key(struct ::wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const QString &text, uint32_t autorepeat, uint32_t count); private: void init_listener(); static const struct zqt_key_v1_listener m_zqt_key_v1_listener; static void handle_key( void *data, struct ::zqt_key_v1 *object, struct ::wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const char *text, uint32_t autorepeat, uint32_t count); struct ::zqt_key_v1 *m_zqt_key_v1; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-qt-windowmanager.h000066400000000000000000000037241476226662200344430ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_QT_WINDOWMANAGER #define QT_WAYLAND_QT_WINDOWMANAGER #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT qt_windowmanager { public: qt_windowmanager(struct ::wl_registry *registry, int id, int version); qt_windowmanager(struct ::qt_windowmanager *object); qt_windowmanager(); virtual ~qt_windowmanager(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_windowmanager *object); struct ::qt_windowmanager *object() { return m_qt_windowmanager; } const struct ::qt_windowmanager *object() const { return m_qt_windowmanager; } bool isInitialized() const; static const struct ::wl_interface *interface(); void open_url(uint32_t remaining, const QString &url); protected: virtual void windowmanager_hints(int32_t show_is_fullscreen); virtual void windowmanager_quit(); private: void init_listener(); static const struct qt_windowmanager_listener m_qt_windowmanager_listener; static void handle_hints( void *data, struct ::qt_windowmanager *object, int32_t show_is_fullscreen); static void handle_quit( void *data, struct ::qt_windowmanager *object); struct ::qt_windowmanager *m_qt_windowmanager; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-server-buffer-extension.h000066400000000000000000000027611476226662200357460ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_SERVER_BUFFER_EXTENSION #define QT_WAYLAND_SERVER_BUFFER_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT qt_server_buffer { public: qt_server_buffer(struct ::wl_registry *registry, int id, int version); qt_server_buffer(struct ::qt_server_buffer *object); qt_server_buffer(); virtual ~qt_server_buffer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_server_buffer *object); struct ::qt_server_buffer *object() { return m_qt_server_buffer; } const struct ::qt_server_buffer *object() const { return m_qt_server_buffer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void release(); private: struct ::qt_server_buffer *m_qt_server_buffer; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-surface-extension.h000066400000000000000000000075021476226662200346170ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_SURFACE_EXTENSION #define QT_WAYLAND_SURFACE_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT qt_surface_extension { public: qt_surface_extension(struct ::wl_registry *registry, int id, int version); qt_surface_extension(struct ::qt_surface_extension *object); qt_surface_extension(); virtual ~qt_surface_extension(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_surface_extension *object); struct ::qt_surface_extension *object() { return m_qt_surface_extension; } const struct ::qt_surface_extension *object() const { return m_qt_surface_extension; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::qt_extended_surface *get_extended_surface(struct ::wl_surface *surface); private: struct ::qt_surface_extension *m_qt_surface_extension; }; class Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT qt_extended_surface { public: qt_extended_surface(struct ::wl_registry *registry, int id, int version); qt_extended_surface(struct ::qt_extended_surface *object); qt_extended_surface(); virtual ~qt_extended_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_extended_surface *object); struct ::qt_extended_surface *object() { return m_qt_extended_surface; } const struct ::qt_extended_surface *object() const { return m_qt_extended_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum orientation { orientation_PrimaryOrientation = 0, orientation_PortraitOrientation = 1, orientation_LandscapeOrientation = 2, orientation_InvertedPortraitOrientation = 4, orientation_InvertedLandscapeOrientation = 8 }; enum windowflag { windowflag_OverridesSystemGestures = 1, windowflag_StaysOnTop = 2, windowflag_BypassWindowManager = 4 }; void update_generic_property(const QString &name, const QByteArray &value); void set_content_orientation_mask(int32_t orientation); void set_window_flags(int32_t flags); void raise(); void lower(); protected: virtual void extended_surface_onscreen_visibility(int32_t visible); virtual void extended_surface_set_generic_property(const QString &name, wl_array *value); virtual void extended_surface_close(); private: void init_listener(); static const struct qt_extended_surface_listener m_qt_extended_surface_listener; static void handle_onscreen_visibility( void *data, struct ::qt_extended_surface *object, int32_t visible); static void handle_set_generic_property( void *data, struct ::qt_extended_surface *object, const char *name, wl_array *value); static void handle_close( void *data, struct ::qt_extended_surface *object); struct ::qt_extended_surface *m_qt_extended_surface; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-text-input-unstable-v2.h000066400000000000000000000247361476226662200354460ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_TEXT_INPUT_UNSTABLE_V2 #define QT_WAYLAND_TEXT_INPUT_UNSTABLE_V2 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT zwp_text_input_v2 { public: zwp_text_input_v2(struct ::wl_registry *registry, int id, int version); zwp_text_input_v2(struct ::zwp_text_input_v2 *object); zwp_text_input_v2(); virtual ~zwp_text_input_v2(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zwp_text_input_v2 *object); struct ::zwp_text_input_v2 *object() { return m_zwp_text_input_v2; } const struct ::zwp_text_input_v2 *object() const { return m_zwp_text_input_v2; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum content_hint { content_hint_none = 0x0, // no special behaviour content_hint_auto_completion = 0x1, // suggest word completions content_hint_auto_correction = 0x2, // suggest word corrections content_hint_auto_capitalization = 0x4, // switch to uppercase letters at the start of a sentence content_hint_lowercase = 0x8, // prefer lowercase letters content_hint_uppercase = 0x10, // prefer uppercase letters content_hint_titlecase = 0x20, // prefer casing for titles and headings (can be language dependent) content_hint_hidden_text = 0x40, // characters should be hidden content_hint_sensitive_data = 0x80, // typed text should not be stored content_hint_latin = 0x100, // just latin characters should be entered content_hint_multiline = 0x200 // the text input is multiline }; enum content_purpose { content_purpose_normal = 0, // default input, allowing all characters content_purpose_alpha = 1, // allow only alphabetic characters content_purpose_digits = 2, // allow only digits content_purpose_number = 3, // input a number (including decimal separator and sign) content_purpose_phone = 4, // input a phone number content_purpose_url = 5, // input an URL content_purpose_email = 6, // input an email address content_purpose_name = 7, // input a name of a person content_purpose_password = 8, // input a password (combine with password or sensitive_data hint) content_purpose_date = 9, // input a date content_purpose_time = 10, // input a time content_purpose_datetime = 11, // input a date and time content_purpose_terminal = 12 // input for a terminal }; enum update_state { update_state_change = 0, // updated state because it changed update_state_full = 1, // full state after enter or input_method_changed event update_state_reset = 2, // full state after reset update_state_enter = 3 // full state after switching focus to a different widget on client side }; enum input_panel_visibility { input_panel_visibility_hidden = 0, // the input panel (virtual keyboard) is hidden input_panel_visibility_visible = 1 // the input panel (virtual keyboard) is visible }; enum preedit_style { preedit_style_default = 0, // default style for composing text preedit_style_none = 1, // composing text should be shown the same as non-composing text preedit_style_active = 2, // composing text might be bold preedit_style_inactive = 3, // composing text might be cursive preedit_style_highlight = 4, // composing text might have a different background color preedit_style_underline = 5, // composing text might be underlined preedit_style_selection = 6, // composing text should be shown the same as selected text preedit_style_incorrect = 7 // composing text might be underlined with a red wavy line }; enum text_direction { text_direction_auto = 0, // automatic text direction based on text and language text_direction_ltr = 1, // left-to-right text_direction_rtl = 2 // right-to-left }; void destroy(); void enable(struct ::wl_surface *surface); void disable(struct ::wl_surface *surface); void show_input_panel(); void hide_input_panel(); void set_surrounding_text(const QString &text, int32_t cursor, int32_t anchor); void set_content_type(uint32_t hint, uint32_t purpose); void set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height); void set_preferred_language(const QString &language); void update_state(uint32_t serial, uint32_t reason); protected: virtual void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface); virtual void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface); virtual void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); virtual void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit); virtual void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style); virtual void zwp_text_input_v2_preedit_cursor(int32_t index); virtual void zwp_text_input_v2_commit_string(const QString &text); virtual void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor); virtual void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length); virtual void zwp_text_input_v2_modifiers_map(wl_array *map); virtual void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); virtual void zwp_text_input_v2_language(const QString &language); virtual void zwp_text_input_v2_text_direction(uint32_t direction); virtual void zwp_text_input_v2_configure_surrounding_text(int32_t before_cursor, int32_t after_cursor); virtual void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags); private: void init_listener(); static const struct zwp_text_input_v2_listener m_zwp_text_input_v2_listener; static void handle_enter( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, struct ::wl_surface *surface); static void handle_leave( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, struct ::wl_surface *surface); static void handle_input_panel_state( void *data, struct ::zwp_text_input_v2 *object, uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); static void handle_preedit_string( void *data, struct ::zwp_text_input_v2 *object, const char *text, const char *commit); static void handle_preedit_styling( void *data, struct ::zwp_text_input_v2 *object, uint32_t index, uint32_t length, uint32_t style); static void handle_preedit_cursor( void *data, struct ::zwp_text_input_v2 *object, int32_t index); static void handle_commit_string( void *data, struct ::zwp_text_input_v2 *object, const char *text); static void handle_cursor_position( void *data, struct ::zwp_text_input_v2 *object, int32_t index, int32_t anchor); static void handle_delete_surrounding_text( void *data, struct ::zwp_text_input_v2 *object, uint32_t before_length, uint32_t after_length); static void handle_modifiers_map( void *data, struct ::zwp_text_input_v2 *object, wl_array *map); static void handle_keysym( void *data, struct ::zwp_text_input_v2 *object, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); static void handle_language( void *data, struct ::zwp_text_input_v2 *object, const char *language); static void handle_text_direction( void *data, struct ::zwp_text_input_v2 *object, uint32_t direction); static void handle_configure_surrounding_text( void *data, struct ::zwp_text_input_v2 *object, int32_t before_cursor, int32_t after_cursor); static void handle_input_method_changed( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, uint32_t flags); struct ::zwp_text_input_v2 *m_zwp_text_input_v2; }; class Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT zwp_text_input_manager_v2 { public: zwp_text_input_manager_v2(struct ::wl_registry *registry, int id, int version); zwp_text_input_manager_v2(struct ::zwp_text_input_manager_v2 *object); zwp_text_input_manager_v2(); virtual ~zwp_text_input_manager_v2(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zwp_text_input_manager_v2 *object); struct ::zwp_text_input_manager_v2 *object() { return m_zwp_text_input_manager_v2; } const struct ::zwp_text_input_manager_v2 *object() const { return m_zwp_text_input_manager_v2; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); struct ::zwp_text_input_v2 *get_text_input(struct ::wl_seat *seat); private: struct ::zwp_text_input_manager_v2 *m_zwp_text_input_manager_v2; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-touch-extension.h000066400000000000000000000052021476226662200343040ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_TOUCH_EXTENSION #define QT_WAYLAND_TOUCH_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT qt_touch_extension { public: qt_touch_extension(struct ::wl_registry *registry, int id, int version); qt_touch_extension(struct ::qt_touch_extension *object); qt_touch_extension(); virtual ~qt_touch_extension(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_touch_extension *object); struct ::qt_touch_extension *object() { return m_qt_touch_extension; } const struct ::qt_touch_extension *object() const { return m_qt_touch_extension; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum flags { flags_mouse_from_touch = 0x1 }; void dummy(); protected: virtual void touch_extension_touch(uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, wl_array *rawdata); virtual void touch_extension_configure(uint32_t flags); private: void init_listener(); static const struct qt_touch_extension_listener m_qt_touch_extension_listener; static void handle_touch( void *data, struct ::qt_touch_extension *object, uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, wl_array *rawdata); static void handle_configure( void *data, struct ::qt_touch_extension *object, uint32_t flags); struct ::qt_touch_extension *m_qt_touch_extension; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwayland-wayland.h000066400000000000000000001057621476226662200327020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_WAYLAND #define QT_WAYLAND_WAYLAND #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_WAYLAND_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_registry { public: wl_registry(struct ::wl_registry *registry, int id, int version); wl_registry(struct ::wl_registry *object); wl_registry(); virtual ~wl_registry(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_registry *object); struct ::wl_registry *object() { return m_wl_registry; } const struct ::wl_registry *object() const { return m_wl_registry; } bool isInitialized() const; static const struct ::wl_interface *interface(); void *bind(uint32_t name, const struct ::wl_interface *interface, uint32_t version); protected: virtual void registry_global(uint32_t name, const QString &interface, uint32_t version); virtual void registry_global_remove(uint32_t name); private: void init_listener(); static const struct wl_registry_listener m_wl_registry_listener; static void handle_global( void *data, struct ::wl_registry *object, uint32_t name, const char *interface, uint32_t version); static void handle_global_remove( void *data, struct ::wl_registry *object, uint32_t name); struct ::wl_registry *m_wl_registry; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_callback { public: wl_callback(struct ::wl_registry *registry, int id, int version); wl_callback(struct ::wl_callback *object); wl_callback(); virtual ~wl_callback(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_callback *object); struct ::wl_callback *object() { return m_wl_callback; } const struct ::wl_callback *object() const { return m_wl_callback; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void callback_done(uint32_t callback_data); private: void init_listener(); static const struct wl_callback_listener m_wl_callback_listener; static void handle_done( void *data, struct ::wl_callback *object, uint32_t callback_data); struct ::wl_callback *m_wl_callback; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_compositor { public: wl_compositor(struct ::wl_registry *registry, int id, int version); wl_compositor(struct ::wl_compositor *object); wl_compositor(); virtual ~wl_compositor(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_compositor *object); struct ::wl_compositor *object() { return m_wl_compositor; } const struct ::wl_compositor *object() const { return m_wl_compositor; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_surface *create_surface(); struct ::wl_region *create_region(); private: struct ::wl_compositor *m_wl_compositor; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm_pool { public: wl_shm_pool(struct ::wl_registry *registry, int id, int version); wl_shm_pool(struct ::wl_shm_pool *object); wl_shm_pool(); virtual ~wl_shm_pool(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shm_pool *object); struct ::wl_shm_pool *object() { return m_wl_shm_pool; } const struct ::wl_shm_pool *object() const { return m_wl_shm_pool; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_buffer *create_buffer(int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format); void destroy(); void resize(int32_t size); private: struct ::wl_shm_pool *m_wl_shm_pool; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm { public: wl_shm(struct ::wl_registry *registry, int id, int version); wl_shm(struct ::wl_shm *object); wl_shm(); virtual ~wl_shm(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shm *object); struct ::wl_shm *object() { return m_wl_shm; } const struct ::wl_shm *object() const { return m_wl_shm; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_invalid_format = 0, // buffer format is not known error_invalid_stride = 1, // invalid size or stride during pool or buffer creation error_invalid_fd = 2 // mmapping the file descriptor failed }; enum format { format_argb8888 = 0, // 32-bit ARGB format format_xrgb8888 = 1, // 32-bit RGB format format_c8 = 0x20203843, format_rgb332 = 0x38424752, format_bgr233 = 0x38524742, format_xrgb4444 = 0x32315258, format_xbgr4444 = 0x32314258, format_rgbx4444 = 0x32315852, format_bgrx4444 = 0x32315842, format_argb4444 = 0x32315241, format_abgr4444 = 0x32314241, format_rgba4444 = 0x32314152, format_bgra4444 = 0x32314142, format_xrgb1555 = 0x35315258, format_xbgr1555 = 0x35314258, format_rgbx5551 = 0x35315852, format_bgrx5551 = 0x35315842, format_argb1555 = 0x35315241, format_abgr1555 = 0x35314241, format_rgba5551 = 0x35314152, format_bgra5551 = 0x35314142, format_rgb565 = 0x36314752, format_bgr565 = 0x36314742, format_rgb888 = 0x34324752, format_bgr888 = 0x34324742, format_xbgr8888 = 0x34324258, format_rgbx8888 = 0x34325852, format_bgrx8888 = 0x34325842, format_abgr8888 = 0x34324241, format_rgba8888 = 0x34324152, format_bgra8888 = 0x34324142, format_xrgb2101010 = 0x30335258, format_xbgr2101010 = 0x30334258, format_rgbx1010102 = 0x30335852, format_bgrx1010102 = 0x30335842, format_argb2101010 = 0x30335241, format_abgr2101010 = 0x30334241, format_rgba1010102 = 0x30334152, format_bgra1010102 = 0x30334142, format_yuyv = 0x56595559, format_yvyu = 0x55595659, format_uyvy = 0x59565955, format_vyuy = 0x59555956, format_ayuv = 0x56555941, format_nv12 = 0x3231564e, format_nv21 = 0x3132564e, format_nv16 = 0x3631564e, format_nv61 = 0x3136564e, format_yuv410 = 0x39565559, format_yvu410 = 0x39555659, format_yuv411 = 0x31315559, format_yvu411 = 0x31315659, format_yuv420 = 0x32315559, format_yvu420 = 0x32315659, format_yuv422 = 0x36315559, format_yvu422 = 0x36315659, format_yuv444 = 0x34325559, format_yvu444 = 0x34325659 }; struct ::wl_shm_pool *create_pool(int32_t fd, int32_t size); protected: virtual void shm_format(uint32_t format); private: void init_listener(); static const struct wl_shm_listener m_wl_shm_listener; static void handle_format( void *data, struct ::wl_shm *object, uint32_t format); struct ::wl_shm *m_wl_shm; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_buffer { public: wl_buffer(struct ::wl_registry *registry, int id, int version); wl_buffer(struct ::wl_buffer *object); wl_buffer(); virtual ~wl_buffer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_buffer *object); struct ::wl_buffer *object() { return m_wl_buffer; } const struct ::wl_buffer *object() const { return m_wl_buffer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); protected: virtual void buffer_release(); private: void init_listener(); static const struct wl_buffer_listener m_wl_buffer_listener; static void handle_release( void *data, struct ::wl_buffer *object); struct ::wl_buffer *m_wl_buffer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_offer { public: wl_data_offer(struct ::wl_registry *registry, int id, int version); wl_data_offer(struct ::wl_data_offer *object); wl_data_offer(); virtual ~wl_data_offer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_offer *object); struct ::wl_data_offer *object() { return m_wl_data_offer; } const struct ::wl_data_offer *object() const { return m_wl_data_offer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void accept(uint32_t serial, const QString &mime_type); void receive(const QString &mime_type, int32_t fd); void destroy(); protected: virtual void data_offer_offer(const QString &mime_type); private: void init_listener(); static const struct wl_data_offer_listener m_wl_data_offer_listener; static void handle_offer( void *data, struct ::wl_data_offer *object, const char *mime_type); struct ::wl_data_offer *m_wl_data_offer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_source { public: wl_data_source(struct ::wl_registry *registry, int id, int version); wl_data_source(struct ::wl_data_source *object); wl_data_source(); virtual ~wl_data_source(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_source *object); struct ::wl_data_source *object() { return m_wl_data_source; } const struct ::wl_data_source *object() const { return m_wl_data_source; } bool isInitialized() const; static const struct ::wl_interface *interface(); void offer(const QString &mime_type); void destroy(); protected: virtual void data_source_target(const QString &mime_type); virtual void data_source_send(const QString &mime_type, int32_t fd); virtual void data_source_cancelled(); private: void init_listener(); static const struct wl_data_source_listener m_wl_data_source_listener; static void handle_target( void *data, struct ::wl_data_source *object, const char *mime_type); static void handle_send( void *data, struct ::wl_data_source *object, const char *mime_type, int32_t fd); static void handle_cancelled( void *data, struct ::wl_data_source *object); struct ::wl_data_source *m_wl_data_source; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device { public: wl_data_device(struct ::wl_registry *registry, int id, int version); wl_data_device(struct ::wl_data_device *object); wl_data_device(); virtual ~wl_data_device(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_device *object); struct ::wl_data_device *object() { return m_wl_data_device; } const struct ::wl_data_device *object() const { return m_wl_data_device; } bool isInitialized() const; static const struct ::wl_interface *interface(); void start_drag(struct ::wl_data_source *source, struct ::wl_surface *origin, struct ::wl_surface *icon, uint32_t serial); void set_selection(struct ::wl_data_source *source, uint32_t serial); protected: virtual void data_device_data_offer(struct ::wl_data_offer *id); virtual void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id); virtual void data_device_leave(); virtual void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y); virtual void data_device_drop(); virtual void data_device_selection(struct ::wl_data_offer *id); private: void init_listener(); static const struct wl_data_device_listener m_wl_data_device_listener; static void handle_data_offer( void *data, struct ::wl_data_device *object, struct ::wl_data_offer *id); static void handle_enter( void *data, struct ::wl_data_device *object, uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id); static void handle_leave( void *data, struct ::wl_data_device *object); static void handle_motion( void *data, struct ::wl_data_device *object, uint32_t time, wl_fixed_t x, wl_fixed_t y); static void handle_drop( void *data, struct ::wl_data_device *object); static void handle_selection( void *data, struct ::wl_data_device *object, struct ::wl_data_offer *id); struct ::wl_data_device *m_wl_data_device; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device_manager { public: wl_data_device_manager(struct ::wl_registry *registry, int id, int version); wl_data_device_manager(struct ::wl_data_device_manager *object); wl_data_device_manager(); virtual ~wl_data_device_manager(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_device_manager *object); struct ::wl_data_device_manager *object() { return m_wl_data_device_manager; } const struct ::wl_data_device_manager *object() const { return m_wl_data_device_manager; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_data_source *create_data_source(); struct ::wl_data_device *get_data_device(struct ::wl_seat *seat); private: struct ::wl_data_device_manager *m_wl_data_device_manager; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell { public: wl_shell(struct ::wl_registry *registry, int id, int version); wl_shell(struct ::wl_shell *object); wl_shell(); virtual ~wl_shell(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shell *object); struct ::wl_shell *object() { return m_wl_shell; } const struct ::wl_shell *object() const { return m_wl_shell; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_shell_surface *get_shell_surface(struct ::wl_surface *surface); private: struct ::wl_shell *m_wl_shell; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell_surface { public: wl_shell_surface(struct ::wl_registry *registry, int id, int version); wl_shell_surface(struct ::wl_shell_surface *object); wl_shell_surface(); virtual ~wl_shell_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shell_surface *object); struct ::wl_shell_surface *object() { return m_wl_shell_surface; } const struct ::wl_shell_surface *object() const { return m_wl_shell_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum resize { resize_none = 0, resize_top = 1, resize_bottom = 2, resize_left = 4, resize_top_left = 5, resize_bottom_left = 6, resize_right = 8, resize_top_right = 9, resize_bottom_right = 10 }; enum transient { transient_inactive = 0x1 // do not set keyboard focus }; enum fullscreen_method { fullscreen_method_default = 0, // no preference, apply default policy fullscreen_method_scale = 1, // scale, preserve the surface's aspect ratio and center on output fullscreen_method_driver = 2, // switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch fullscreen_method_fill = 3 // no upscaling, center on output and add black borders to compensate size mismatch }; void pong(uint32_t serial); void move(struct ::wl_seat *seat, uint32_t serial); void resize(struct ::wl_seat *seat, uint32_t serial, uint32_t edges); void set_toplevel(); void set_transient(struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags); void set_fullscreen(uint32_t method, uint32_t framerate, struct ::wl_output *output); void set_popup(struct ::wl_seat *seat, uint32_t serial, struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags); void set_maximized(struct ::wl_output *output); void set_title(const QString &title); void set_class(const QString &class_); protected: virtual void shell_surface_ping(uint32_t serial); virtual void shell_surface_configure(uint32_t edges, int32_t width, int32_t height); virtual void shell_surface_popup_done(); private: void init_listener(); static const struct wl_shell_surface_listener m_wl_shell_surface_listener; static void handle_ping( void *data, struct ::wl_shell_surface *object, uint32_t serial); static void handle_configure( void *data, struct ::wl_shell_surface *object, uint32_t edges, int32_t width, int32_t height); static void handle_popup_done( void *data, struct ::wl_shell_surface *object); struct ::wl_shell_surface *m_wl_shell_surface; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_surface { public: wl_surface(struct ::wl_registry *registry, int id, int version); wl_surface(struct ::wl_surface *object); wl_surface(); virtual ~wl_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_surface *object); struct ::wl_surface *object() { return m_wl_surface; } const struct ::wl_surface *object() const { return m_wl_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_invalid_scale = 0, // buffer scale value is invalid error_invalid_transform = 1 // buffer transform value is invalid }; void destroy(); void attach(struct ::wl_buffer *buffer, int32_t x, int32_t y); void damage(int32_t x, int32_t y, int32_t width, int32_t height); struct ::wl_callback *frame(); void set_opaque_region(struct ::wl_region *region); void set_input_region(struct ::wl_region *region); void commit(); void set_buffer_transform(int32_t transform); void set_buffer_scale(int32_t scale); protected: virtual void surface_enter(struct ::wl_output *output); virtual void surface_leave(struct ::wl_output *output); private: void init_listener(); static const struct wl_surface_listener m_wl_surface_listener; static void handle_enter( void *data, struct ::wl_surface *object, struct ::wl_output *output); static void handle_leave( void *data, struct ::wl_surface *object, struct ::wl_output *output); struct ::wl_surface *m_wl_surface; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_seat { public: wl_seat(struct ::wl_registry *registry, int id, int version); wl_seat(struct ::wl_seat *object); wl_seat(); virtual ~wl_seat(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_seat *object); struct ::wl_seat *object() { return m_wl_seat; } const struct ::wl_seat *object() const { return m_wl_seat; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum capability { capability_pointer = 1, // The seat has pointer devices capability_keyboard = 2, // The seat has one or more keyboards capability_touch = 4 // The seat has touch devices }; struct ::wl_pointer *get_pointer(); struct ::wl_keyboard *get_keyboard(); struct ::wl_touch *get_touch(); protected: virtual void seat_capabilities(uint32_t capabilities); virtual void seat_name(const QString &name); private: void init_listener(); static const struct wl_seat_listener m_wl_seat_listener; static void handle_capabilities( void *data, struct ::wl_seat *object, uint32_t capabilities); static void handle_name( void *data, struct ::wl_seat *object, const char *name); struct ::wl_seat *m_wl_seat; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_pointer { public: wl_pointer(struct ::wl_registry *registry, int id, int version); wl_pointer(struct ::wl_pointer *object); wl_pointer(); virtual ~wl_pointer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_pointer *object); struct ::wl_pointer *object() { return m_wl_pointer; } const struct ::wl_pointer *object() const { return m_wl_pointer; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum button_state { button_state_released = 0, // The button is not pressed button_state_pressed = 1 // The button is pressed }; enum axis { axis_vertical_scroll = 0, axis_horizontal_scroll = 1 }; void set_cursor(uint32_t serial, struct ::wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y); void release(); protected: virtual void pointer_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); virtual void pointer_leave(uint32_t serial, struct ::wl_surface *surface); virtual void pointer_motion(uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); virtual void pointer_button(uint32_t serial, uint32_t time, uint32_t button, uint32_t state); virtual void pointer_axis(uint32_t time, uint32_t axis, wl_fixed_t value); private: void init_listener(); static const struct wl_pointer_listener m_wl_pointer_listener; static void handle_enter( void *data, struct ::wl_pointer *object, uint32_t serial, struct ::wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); static void handle_leave( void *data, struct ::wl_pointer *object, uint32_t serial, struct ::wl_surface *surface); static void handle_motion( void *data, struct ::wl_pointer *object, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); static void handle_button( void *data, struct ::wl_pointer *object, uint32_t serial, uint32_t time, uint32_t button, uint32_t state); static void handle_axis( void *data, struct ::wl_pointer *object, uint32_t time, uint32_t axis, wl_fixed_t value); struct ::wl_pointer *m_wl_pointer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_keyboard { public: wl_keyboard(struct ::wl_registry *registry, int id, int version); wl_keyboard(struct ::wl_keyboard *object); wl_keyboard(); virtual ~wl_keyboard(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_keyboard *object); struct ::wl_keyboard *object() { return m_wl_keyboard; } const struct ::wl_keyboard *object() const { return m_wl_keyboard; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum keymap_format { keymap_format_no_keymap = 0, // no keymap; client must understand how to interpret the raw keycode keymap_format_xkb_v1 = 1 // libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode }; enum key_state { key_state_released = 0, // key is not pressed key_state_pressed = 1 // key is pressed }; void release(); protected: virtual void keyboard_keymap(uint32_t format, int32_t fd, uint32_t size); virtual void keyboard_enter(uint32_t serial, struct ::wl_surface *surface, wl_array *keys); virtual void keyboard_leave(uint32_t serial, struct ::wl_surface *surface); virtual void keyboard_key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state); virtual void keyboard_modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); virtual void keyboard_repeat_info(int32_t rate, int32_t delay); private: void init_listener(); static const struct wl_keyboard_listener m_wl_keyboard_listener; static void handle_keymap( void *data, struct ::wl_keyboard *object, uint32_t format, int32_t fd, uint32_t size); static void handle_enter( void *data, struct ::wl_keyboard *object, uint32_t serial, struct ::wl_surface *surface, wl_array *keys); static void handle_leave( void *data, struct ::wl_keyboard *object, uint32_t serial, struct ::wl_surface *surface); static void handle_key( void *data, struct ::wl_keyboard *object, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); static void handle_modifiers( void *data, struct ::wl_keyboard *object, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); static void handle_repeat_info( void *data, struct ::wl_keyboard *object, int32_t rate, int32_t delay); struct ::wl_keyboard *m_wl_keyboard; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_touch { public: wl_touch(struct ::wl_registry *registry, int id, int version); wl_touch(struct ::wl_touch *object); wl_touch(); virtual ~wl_touch(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_touch *object); struct ::wl_touch *object() { return m_wl_touch; } const struct ::wl_touch *object() const { return m_wl_touch; } bool isInitialized() const; static const struct ::wl_interface *interface(); void release(); protected: virtual void touch_down(uint32_t serial, uint32_t time, struct ::wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); virtual void touch_up(uint32_t serial, uint32_t time, int32_t id); virtual void touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); virtual void touch_frame(); virtual void touch_cancel(); private: void init_listener(); static const struct wl_touch_listener m_wl_touch_listener; static void handle_down( void *data, struct ::wl_touch *object, uint32_t serial, uint32_t time, struct ::wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); static void handle_up( void *data, struct ::wl_touch *object, uint32_t serial, uint32_t time, int32_t id); static void handle_motion( void *data, struct ::wl_touch *object, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); static void handle_frame( void *data, struct ::wl_touch *object); static void handle_cancel( void *data, struct ::wl_touch *object); struct ::wl_touch *m_wl_touch; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_output { public: wl_output(struct ::wl_registry *registry, int id, int version); wl_output(struct ::wl_output *object); wl_output(); virtual ~wl_output(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_output *object); struct ::wl_output *object() { return m_wl_output; } const struct ::wl_output *object() const { return m_wl_output; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum subpixel { subpixel_unknown = 0, subpixel_none = 1, subpixel_horizontal_rgb = 2, subpixel_horizontal_bgr = 3, subpixel_vertical_rgb = 4, subpixel_vertical_bgr = 5 }; enum transform { transform_normal = 0, transform_90 = 1, transform_180 = 2, transform_270 = 3, transform_flipped = 4, transform_flipped_90 = 5, transform_flipped_180 = 6, transform_flipped_270 = 7 }; enum mode { mode_current = 0x1, // indicates this is the current mode mode_preferred = 0x2 // indicates this is the preferred mode }; protected: virtual void output_geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const QString &make, const QString &model, int32_t transform); virtual void output_mode(uint32_t flags, int32_t width, int32_t height, int32_t refresh); virtual void output_done(); virtual void output_scale(int32_t factor); private: void init_listener(); static const struct wl_output_listener m_wl_output_listener; static void handle_geometry( void *data, struct ::wl_output *object, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform); static void handle_mode( void *data, struct ::wl_output *object, uint32_t flags, int32_t width, int32_t height, int32_t refresh); static void handle_done( void *data, struct ::wl_output *object); static void handle_scale( void *data, struct ::wl_output *object, int32_t factor); struct ::wl_output *m_wl_output; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_region { public: wl_region(struct ::wl_registry *registry, int id, int version); wl_region(struct ::wl_region *object); wl_region(); virtual ~wl_region(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_region *object); struct ::wl_region *object() { return m_wl_region; } const struct ::wl_region *object() const { return m_wl_region; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); void add(int32_t x, int32_t y, int32_t width, int32_t height); void subtract(int32_t x, int32_t y, int32_t width, int32_t height); private: struct ::wl_region *m_wl_region; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subcompositor { public: wl_subcompositor(struct ::wl_registry *registry, int id, int version); wl_subcompositor(struct ::wl_subcompositor *object); wl_subcompositor(); virtual ~wl_subcompositor(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_subcompositor *object); struct ::wl_subcompositor *object() { return m_wl_subcompositor; } const struct ::wl_subcompositor *object() const { return m_wl_subcompositor; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_bad_surface = 0 // the to-be sub-surface is invalid }; void destroy(); struct ::wl_subsurface *get_subsurface(struct ::wl_surface *surface, struct ::wl_surface *parent); private: struct ::wl_subcompositor *m_wl_subcompositor; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subsurface { public: wl_subsurface(struct ::wl_registry *registry, int id, int version); wl_subsurface(struct ::wl_subsurface *object); wl_subsurface(); virtual ~wl_subsurface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_subsurface *object); struct ::wl_subsurface *object() { return m_wl_subsurface; } const struct ::wl_subsurface *object() const { return m_wl_subsurface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_bad_surface = 0 // wl_surface is not a sibling or the parent }; void destroy(); void set_position(int32_t x, int32_t y); void place_above(struct ::wl_surface *sibling); void place_below(struct ::wl_surface *sibling); void set_sync(); void set_desync(); private: struct ::wl_subsurface *m_wl_subsurface; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-xdg-output-unstable-v1.h000066400000000000000000000070241476226662200354330ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_XDG_OUTPUT_UNSTABLE_V1 #define QT_WAYLAND_XDG_OUTPUT_UNSTABLE_V1 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT zxdg_output_manager_v1 { public: zxdg_output_manager_v1(struct ::wl_registry *registry, int id, int version); zxdg_output_manager_v1(struct ::zxdg_output_manager_v1 *object); zxdg_output_manager_v1(); virtual ~zxdg_output_manager_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zxdg_output_manager_v1 *object); struct ::zxdg_output_manager_v1 *object() { return m_zxdg_output_manager_v1; } const struct ::zxdg_output_manager_v1 *object() const { return m_zxdg_output_manager_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); struct ::zxdg_output_v1 *get_xdg_output(struct ::wl_output *output); private: struct ::zxdg_output_manager_v1 *m_zxdg_output_manager_v1; }; class Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT zxdg_output_v1 { public: zxdg_output_v1(struct ::wl_registry *registry, int id, int version); zxdg_output_v1(struct ::zxdg_output_v1 *object); zxdg_output_v1(); virtual ~zxdg_output_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zxdg_output_v1 *object); struct ::zxdg_output_v1 *object() { return m_zxdg_output_v1; } const struct ::zxdg_output_v1 *object() const { return m_zxdg_output_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); protected: virtual void zxdg_output_v1_logical_position(int32_t x, int32_t y); virtual void zxdg_output_v1_logical_size(int32_t width, int32_t height); virtual void zxdg_output_v1_done(); virtual void zxdg_output_v1_name(const QString &name); virtual void zxdg_output_v1_description(const QString &description); private: void init_listener(); static const struct zxdg_output_v1_listener m_zxdg_output_v1_listener; static void handle_logical_position( void *data, struct ::zxdg_output_v1 *object, int32_t x, int32_t y); static void handle_logical_size( void *data, struct ::zxdg_output_v1 *object, int32_t width, int32_t height); static void handle_done( void *data, struct ::zxdg_output_v1 *object); static void handle_name( void *data, struct ::zxdg_output_v1 *object, const char *name); static void handle_description( void *data, struct ::zxdg_output_v1 *object, const char *description); struct ::zxdg_output_v1 *m_zxdg_output_v1; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwaylandabstractdecoration_p.h000066400000000000000000000044271476226662200352750ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2017 Robin Burchell // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDABSTRACTDECORATION_H #define QWAYLANDABSTRACTDECORATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class QWindow; class QPaintDevice; class QPainter; class QEvent; namespace QtWaylandClient { class QWaylandScreen; class QWaylandWindow; class QWaylandInputDevice; class QWaylandAbstractDecorationPrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandAbstractDecoration) public: QWaylandAbstractDecoration(); ~QWaylandAbstractDecoration() override; void setWaylandWindow(QWaylandWindow *window); QWaylandWindow *waylandWindow() const; void update(); bool isDirty() const; virtual QMargins margins() const = 0; QWindow *window() const; const QImage &contentImage(); virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) = 0; virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) = 0; protected: virtual void paint(QPaintDevice *device) = 0; void setMouseButtons(Qt::MouseButtons mb); void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons); void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons); bool isLeftClicked(Qt::MouseButtons newMouseButtonState); bool isLeftReleased(Qt::MouseButtons newMouseButtonState); }; } QT_END_NAMESPACE #endif // QWAYLANDABSTRACTDECORATION_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandbuffer_p.h000066400000000000000000000024701476226662200327460ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDBUFFER_H #define QWAYLANDBUFFER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer { public: QWaylandBuffer(); virtual ~QWaylandBuffer(); void init(wl_buffer *buf); wl_buffer *buffer() {return mBuffer;} virtual QSize size() const = 0; virtual int scale() const { return 1; } void setBusy() { mBusy = true; } bool busy() const { return mBusy; } void setCommitted() { mCommitted = true; } bool committed() const { return mCommitted; } protected: struct wl_buffer *mBuffer = nullptr; private: bool mBusy = false; bool mCommitted = false; static void release(void *data, wl_buffer *); static const wl_buffer_listener listener; }; } QT_END_NAMESPACE #endif // QWAYLANDBUFFER_H qwaylandclientbufferintegration_p.h000066400000000000000000000032141476226662200363270ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H #define QWAYLANDCLIENTBUFFERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE class QWindow; class QPlatformOpenGLContext; class QSurfaceFormat; namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegration { public: QWaylandClientBufferIntegration(); virtual ~QWaylandClientBufferIntegration(); virtual void initialize(QWaylandDisplay *display) = 0; virtual bool isValid() const { return true; } virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsWindowDecoration() const { return false; } virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; enum NativeResource { EglDisplay, EglConfig, EglContext }; virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; } virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATION_H qwaylandclientbufferintegrationfactory_p.h000066400000000000000000000017441476226662200377250ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H #define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandClientBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H qwaylandclientbufferintegrationplugin_p.h000066400000000000000000000023651476226662200375540ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandClientBufferIntegration; #define QWaylandClientBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandClientBufferIntegrationPlugin() override; virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H qwaylandclientextension.h000066400000000000000000000045161476226662200343150ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2017 Erik Larsson. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTEXTENSION_H #define QWAYLANDCLIENTEXTENSION_H #include #include struct wl_interface; struct wl_registry; QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandIntegration; } class QWaylandClientExtensionPrivate; class QWaylandClientExtensionTemplatePrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtension : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandClientExtension) Q_PROPERTY(int protocolVersion READ version NOTIFY versionChanged) Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) public: QWaylandClientExtension(const int version); QtWaylandClient::QWaylandIntegration *integration() const; int version() const; bool isActive() const; virtual const struct wl_interface *extensionInterface() const = 0; virtual void bind(struct ::wl_registry *registry, int id, int version) = 0; protected: void setVersion(const int version); Q_SIGNALS: void versionChanged(); void activeChanged(); private Q_SLOTS: void addRegistryListener(); }; template class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplate : public QWaylandClientExtension { Q_DECLARE_PRIVATE(QWaylandClientExtensionTemplate) public: QWaylandClientExtensionTemplate(const int ver) : QWaylandClientExtension(ver) { } const struct wl_interface *extensionInterface() const override { return T::interface(); } void bind(struct ::wl_registry *registry, int id, int ver) override { T* instance = static_cast(this); // Make sure lowest version is used of the supplied version from the // developer and the version specified in the protocol and also the // compositor version. if (this->version() > T::interface()->version) { qWarning("Supplied protocol version to QWaylandClientExtensionTemplate is higher than the version of the protocol, using protocol version instead."); } int minVersion = qMin(ver, qMin(T::interface()->version, this->version())); setVersion(minVersion); instance->init(registry, id, minVersion); } }; QT_END_NAMESPACE #endif // QWAYLANDCLIENTEXTENSION_H qwaylandclientextension_p.h000066400000000000000000000024341476226662200346310ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2017 Erik Larsson. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTEXTENSION_P_H #define QWAYLANDCLIENTEXTENSION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QWaylandClientExtension) public: QWaylandClientExtensionPrivate(); static void handleRegistryGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); QtWaylandClient::QWaylandIntegration *waylandIntegration = nullptr; int version = -1; bool active = false; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate { public: QWaylandClientExtensionTemplatePrivate() { } }; QT_END_NAMESPACE #endif /*QWAYLANDCLIENTEXTENSION_P_H*/ qwaylandclipboard_p.h000066400000000000000000000023661476226662200333610ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIPBOARD_H #define QWAYLANDCLIPBOARD_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_REQUIRE_CONFIG(clipboard); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandClipboard : public QPlatformClipboard { public: QWaylandClipboard(QWaylandDisplay *display); ~QWaylandClipboard() override; QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; private: QWaylandDisplay *mDisplay = nullptr; QMimeData m_emptyData; }; } QT_END_NAMESPACE #endif // QWAYLANDCLIPBOARD_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandcursor_p.h000066400000000000000000000054721476226662200330170ustar00rootroot00000000000000// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCURSOR_H #define QWAYLANDCURSOR_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #if QT_CONFIG(cursor) struct wl_cursor; struct wl_cursor_image; struct wl_cursor_theme; QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandBuffer; class QWaylandDisplay; class QWaylandScreen; class QWaylandShm; class Q_WAYLAND_CLIENT_EXPORT QWaylandCursorTheme { public: static QWaylandCursorTheme *create(QWaylandShm *shm, int size); static QWaylandCursorTheme *create(QWaylandShm *shm, int size, const QString &themeName); ~QWaylandCursorTheme(); struct wl_cursor_image *cursorImage(Qt::CursorShape shape); private: enum WaylandCursor { ArrowCursor = Qt::ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IBeamCursor, SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor, PointingHandCursor, ForbiddenCursor, WhatsThisCursor, BusyCursor, OpenHandCursor, ClosedHandCursor, DragCopyCursor, DragMoveCursor, DragLinkCursor, // The following are used for cursors that don't have equivalents in Qt ResizeNorthCursor = Qt::CustomCursor + 1, ResizeSouthCursor, ResizeEastCursor, ResizeWestCursor, ResizeNorthWestCursor, ResizeSouthEastCursor, ResizeNorthEastCursor, ResizeSouthWestCursor }; explicit QWaylandCursorTheme(struct ::wl_cursor_theme *theme) : m_theme(theme) {} struct ::wl_cursor *requestCursor(WaylandCursor shape); struct ::wl_cursor_theme *m_theme = nullptr; QMap m_cursors; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandCursor : public QPlatformCursor { public: QWaylandCursor(QWaylandScreen *screen); void changeCursor(QCursor *cursor, QWindow *window) override; void pointerEvent(const QMouseEvent &event) override; QPoint pos() const override; void setPos(const QPoint &pos) override; QSharedPointer cursorBitmapImage(const QCursor *cursor); struct wl_cursor_image *cursorImage(Qt::CursorShape shape); private: QWaylandDisplay *mDisplay = nullptr; QWaylandCursorTheme *mCursorTheme = nullptr; QPoint mLastPos; }; } QT_END_NAMESPACE #endif // cursor #endif // QWAYLANDCURSOR_H qwaylanddatadevice_p.h000066400000000000000000000052041476226662200335050ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Klarälvdalens Datakonsult AB (KDAB). // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATADEVICE_H #define QWAYLANDDATADEVICE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE class QMimeData; class QWindow; namespace QtWaylandClient { class QWaylandDisplay; class QWaylandDataDeviceManager; class QWaylandDataOffer; class QWaylandDataSource; class QWaylandInputDevice; class QWaylandWindow; class QWaylandDataDevice : public QObject, public QtWayland::wl_data_device { Q_OBJECT public: QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWaylandInputDevice *inputDevice); ~QWaylandDataDevice() override; QWaylandDataOffer *selectionOffer() const; void invalidateSelectionOffer(); QWaylandDataSource *selectionSource() const; void setSelectionSource(QWaylandDataSource *source); #if QT_CONFIG(draganddrop) QWaylandDataOffer *dragOffer() const; void startDrag(QMimeData *mimeData, QWaylandWindow *icon); void cancelDrag(); #endif protected: void data_device_data_offer(struct ::wl_data_offer *id) override; #if QT_CONFIG(draganddrop) void data_device_drop() override; void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id) override; void data_device_leave() override; void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y) override; #endif void data_device_selection(struct ::wl_data_offer *id) override; private Q_SLOTS: void selectionSourceCancelled(); #if QT_CONFIG(draganddrop) void dragSourceCancelled(); void dragSourceTargetChanged(const QString &mimeType); #endif private: #if QT_CONFIG(draganddrop) QPoint calculateDragPosition(int x, int y, QWindow *wnd) const; #endif QWaylandDisplay *m_display = nullptr; QWaylandInputDevice *m_inputDevice = nullptr; uint32_t m_enterSerial = 0; QPointer m_dragWindow; QPoint m_dragPoint; QScopedPointer m_dragOffer; QScopedPointer m_selectionOffer; QScopedPointer m_selectionSource; QScopedPointer m_dragSource; }; } QT_END_NAMESPACE #endif // QWAYLANDDATADEVICE_H qwaylanddatadevicemanager_p.h000066400000000000000000000022551476226662200350430ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATADEVICEMANAGER_H #define QWAYLANDDATADEVICEMANAGER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandDataDevice; class QWaylandDataSource; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataDeviceManager : public QtWayland::wl_data_device_manager { public: QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id); ~QWaylandDataDeviceManager() override; QWaylandDataDevice *getDataDevice(QWaylandInputDevice *inputDevice); QWaylandDisplay *display() const; private: QWaylandDisplay *m_display = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDDATADEVICEMANAGER_H qwaylanddataoffer_p.h000066400000000000000000000034741476226662200333560ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATAOFFER_H #define QWAYLANDDATAOFFER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandMimeData; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataOffer : public QtWayland::wl_data_offer { public: explicit QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer); ~QWaylandDataOffer() override; QString firstFormat() const; QMimeData *mimeData(); protected: void data_offer_offer(const QString &mime_type) override; private: QScopedPointer m_mimeData; }; class QWaylandMimeData : public QInternalMimeData { public: explicit QWaylandMimeData(QWaylandDataOffer *dataOffer, QWaylandDisplay *display); ~QWaylandMimeData() override; void appendFormat(const QString &mimeType); protected: bool hasFormat_sys(const QString &mimeType) const override; QStringList formats_sys() const override; QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const override; private: int readData(int fd, QByteArray &data) const; mutable QWaylandDataOffer *m_dataOffer = nullptr; QWaylandDisplay *m_display = nullptr; mutable QStringList m_types; mutable QHash m_data; }; } QT_END_NAMESPACE #endif qwaylanddatasource_p.h000066400000000000000000000026301476226662200335460ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATASOURCE_H #define QWAYLANDDATASOURCE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE class QMimeData; namespace QtWaylandClient { class QWaylandDataDeviceManager; class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataSource : public QObject, public QtWayland::wl_data_source { Q_OBJECT public: QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData); ~QWaylandDataSource() override; QMimeData *mimeData() const; Q_SIGNALS: void targetChanged(const QString &mime_type); void cancelled(); protected: void data_source_cancelled() override; void data_source_send(const QString &mime_type, int32_t fd) override; void data_source_target(const QString &mime_type) override; private: QWaylandDisplay *m_display = nullptr; QMimeData *m_mime_data = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDDATASOURCE_H qwaylanddecorationfactory_p.h000066400000000000000000000016771476226662200351450ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Robin Burchell // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDECORATIONFACTORY_H #define QWAYLANDDECORATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandAbstractDecoration; class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDDECORATIONFACTORY_H qwaylanddecorationplugin_p.h000066400000000000000000000022341476226662200347620ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Robin Burchell // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDECORATIONPLUGIN_H #define QWAYLANDDECORATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandAbstractDecoration; #define QWaylandDecorationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandDecorationFactoryInterface.5.4" class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject { Q_OBJECT public: explicit QWaylandDecorationPlugin(QObject *parent = nullptr); ~QWaylandDecorationPlugin() override; virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDDECORATIONPLUGIN_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylanddisplay_p.h000066400000000000000000000171631476226662200331470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDISPLAY_H #define QWAYLANDDISPLAY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include struct wl_cursor_image; QT_BEGIN_NAMESPACE class QAbstractEventDispatcher; class QSocketNotifier; class QPlatformScreen; namespace QtWayland { class qt_surface_extension; class zwp_text_input_manager_v2; class zxdg_output_manager_v1; } namespace QtWaylandClient { Q_WAYLAND_CLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaWayland); class QWaylandInputDevice; class QWaylandBuffer; class QWaylandScreen; class QWaylandClientBufferIntegration; class QWaylandWindowManagerIntegration; class QWaylandDataDeviceManager; class QWaylandTouchExtension; class QWaylandQtKeyExtension; class QWaylandWindow; class QWaylandIntegration; class QWaylandHardwareIntegration; class QWaylandShellSurface; class QWaylandCursorTheme; typedef void (*RegistryListener)(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland::wl_registry { Q_OBJECT public: QWaylandDisplay(QWaylandIntegration *waylandIntegration); ~QWaylandDisplay(void) override; QList screens() const { return mScreens; } QWaylandScreen *screenForOutput(struct wl_output *output) const; struct wl_surface *createSurface(void *handle); QWaylandShellSurface *createShellSurface(QWaylandWindow *window); struct ::wl_region *createRegion(const QRegion &qregion); struct ::wl_subsurface *createSubSurface(QWaylandWindow *window, QWaylandWindow *parent); QWaylandClientBufferIntegration *clientBufferIntegration() const; QWaylandWindowManagerIntegration *windowManagerIntegration() const; #if QT_CONFIG(cursor) void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image, qreal dpr); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot, qreal dpr); QWaylandCursorTheme *loadCursorTheme(qreal devicePixelRatio); #endif struct wl_display *wl_display() const { return mDisplay; } struct ::wl_registry *wl_registry() { return object(); } const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } QtWayland::wl_compositor *compositor() { return &mCompositor; } int compositorVersion() const { return mCompositorVersion; } QList inputDevices() const { return mInputDevices; } QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } #if QT_CONFIG(wayland_datadevice) QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } #endif QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); } QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } QtWayland::zxdg_output_manager_v1 *xdgOutputManager() const { return mXdgOutputManager.data(); } struct RegistryGlobal { uint32_t id; QString interface; uint32_t version; struct ::wl_registry *registry = nullptr; RegistryGlobal(uint32_t id_, const QString &interface_, uint32_t version_, struct ::wl_registry *registry_) : id(id_), interface(interface_), version(version_), registry(registry_) { } }; QList globals() const { return mGlobals; } bool hasRegistryGlobal(const QString &interfaceName); /* wl_registry_add_listener does not add but rather sets a listener, so this function is used * to enable many listeners at once. */ void addRegistryListener(RegistryListener listener, void *data); QWaylandShm *shm() const { return mShm.data(); } static uint32_t currentTimeMillisec(); void forceRoundTrip(); bool supportsWindowDecoration() const; uint32_t lastInputSerial() const { return mLastInputSerial; } QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; } QWaylandWindow *lastInputWindow() const; void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window); void handleWindowActivated(QWaylandWindow *window); void handleWindowDeactivated(QWaylandWindow *window); void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); void handleWindowDestroyed(QWaylandWindow *window); public slots: void blockingReadEvents(); void flushRequests(); private: void waitForScreens(); void exitWithError(); void checkError() const; void handleWaylandSync(); void requestWaylandSync(); struct Listener { RegistryListener listener = nullptr; void *data = nullptr; }; struct wl_display *mDisplay = nullptr; QtWayland::wl_compositor mCompositor; QScopedPointer mShm; QList mScreens; QList mInputDevices; QList mRegistryListeners; QWaylandIntegration *mWaylandIntegration = nullptr; #if QT_CONFIG(cursor) QMap mCursorThemesBySize; #endif #if QT_CONFIG(wayland_datadevice) QScopedPointer mDndSelectionHandler; #endif QScopedPointer mWindowExtension; QScopedPointer mSubCompositor; QScopedPointer mTouchExtension; QScopedPointer mQtKeyExtension; QScopedPointer mWindowManagerIntegration; QScopedPointer mTextInputManager; QScopedPointer mHardwareIntegration; QScopedPointer mXdgOutputManager; QSocketNotifier *mReadNotifier = nullptr; int mFd; int mWritableNotificationFd; QList mGlobals; int mCompositorVersion; uint32_t mLastInputSerial = 0; QWaylandInputDevice *mLastInputDevice = nullptr; QPointer mLastInputWindow; QPointer mLastKeyboardFocus; QVector mActiveWindows; struct wl_callback *mSyncCallback = nullptr; static const wl_callback_listener syncCallbackListener; void registry_global(uint32_t id, const QString &interface, uint32_t version) override; void registry_global_remove(uint32_t id) override; static void shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, int32_t width, int32_t height); }; } QT_END_NAMESPACE #endif // QWAYLANDDISPLAY_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylanddnd_p.h000066400000000000000000000024421476226662200322410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDND_H #define QWAYLANDDND_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; #if QT_CONFIG(draganddrop) class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag { public: QWaylandDrag(QWaylandDisplay *display); ~QWaylandDrag() override; void updateTarget(const QString &mimeType); void setResponse(const QPlatformDragQtResponse &response); void finishDrag(const QPlatformDropQtResponse &response); protected: void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; private: QWaylandDisplay *m_display = nullptr; }; #endif } QT_END_NAMESPACE #endif // QWAYLANDDND_H qwaylandextendedsurface_p.h000066400000000000000000000027171476226662200345730ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDEXTENDEDSURFACE_H #define QWAYLANDEXTENDEDSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface { public: QWaylandExtendedSurface(QWaylandWindow *window); ~QWaylandExtendedSurface() override; void setContentOrientationMask(Qt::ScreenOrientations mask); void updateGenericProperty(const QString &name, const QVariant &value); Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); private: void extended_surface_onscreen_visibility(int32_t visibility) override; void extended_surface_set_generic_property(const QString &name, wl_array *value) override; void extended_surface_close() override; QWaylandWindow *m_window = nullptr; QVariantMap m_properties; }; } QT_END_NAMESPACE #endif // QWAYLANDEXTENDEDSURFACE_H qwaylandhardwareintegration_p.h000066400000000000000000000022131476226662200354520ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDHARDWAREINTEGRATION_H #define QWAYLANDHARDWAREINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandHardwareIntegration : public QtWayland::qt_hardware_integration { public: QWaylandHardwareIntegration(struct ::wl_registry *registry, int id); QString clientBufferIntegration(); QString serverBufferIntegration(); protected: void hardware_integration_client_backend(const QString &name) override; void hardware_integration_server_backend(const QString &name) override; private: QString m_client_buffer; QString m_server_buffer; }; } QT_END_NAMESPACE #endif qwaylandinputcontext_p.h000066400000000000000000000101241476226662200341550ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTCONTEXT_H #define QWAYLANDINPUTCONTEXT_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(qLcQpaInputMethods) namespace QtWaylandClient { class QWaylandDisplay; class QWaylandTextInput : public QtWayland::zwp_text_input_v2 { public: QWaylandTextInput(QWaylandDisplay *display, struct ::zwp_text_input_v2 *text_input); ~QWaylandTextInput() override; void reset(); void commit(); void updateState(Qt::InputMethodQueries queries, uint32_t flags); void setCursorInsidePreedit(int cursor); bool isInputPanelVisible() const; QRectF keyboardRect() const; QLocale locale() const; Qt::LayoutDirection inputDirection() const; protected: void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface) override; void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface) override; void zwp_text_input_v2_modifiers_map(wl_array *map) override; void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height) override; void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit) override; void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style) override; void zwp_text_input_v2_preedit_cursor(int32_t index) override; void zwp_text_input_v2_commit_string(const QString &text) override; void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor) override; void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override; void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override; void zwp_text_input_v2_language(const QString &language) override; void zwp_text_input_v2_text_direction(uint32_t direction) override; void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags) override; private: Qt::KeyboardModifiers modifiersToQtModifiers(uint32_t modifiers); QWaylandDisplay *m_display = nullptr; QWaylandInputMethodEventBuilder m_builder; QVector m_modifiersMap; uint32_t m_serial = 0; struct ::wl_surface *m_surface = nullptr; QString m_preeditCommit; bool m_inputPanelVisible = false; QRectF m_keyboardRectangle; QLocale m_locale; Qt::LayoutDirection m_inputDirection = Qt::LayoutDirectionAuto; struct ::wl_callback *m_resetCallback = nullptr; static const wl_callback_listener callbackListener; static void resetCallback(void *data, struct wl_callback *wl_callback, uint32_t time); }; class QWaylandInputContext : public QPlatformInputContext { Q_OBJECT public: explicit QWaylandInputContext(QWaylandDisplay *display); ~QWaylandInputContext() override; bool isValid() const override; void reset() override; void commit() override; void update(Qt::InputMethodQueries) override; void invokeAction(QInputMethod::Action, int cursorPosition) override; void showInputPanel() override; void hideInputPanel() override; bool isInputPanelVisible() const override; QRectF keyboardRect() const override; QLocale locale() const override; Qt::LayoutDirection inputDirection() const override; void setFocusObject(QObject *object) override; private: QWaylandTextInput *textInput() const; QWaylandDisplay *mDisplay = nullptr; QPointer mCurrentWindow; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTCONTEXT_H qwaylandinputdevice_p.h000066400000000000000000000207531476226662200337410ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICE_H #define QWAYLANDINPUTDEVICE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include #if QT_CONFIG(xkbcommon_evdev) #include #include #endif #include #include #if QT_CONFIG(cursor) struct wl_cursor_image; #endif #if QT_CONFIG(xkbcommon_evdev) struct xkb_compose_state; struct xkb_compose_table; #endif QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandDataDevice; class QWaylandTextInput; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice : public QObject , public QtWayland::wl_seat { Q_OBJECT public: class Keyboard; class Pointer; class Touch; QWaylandInputDevice(QWaylandDisplay *display, int version, uint32_t id); ~QWaylandInputDevice() override; uint32_t capabilities() const { return mCaps; } struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } #if QT_CONFIG(cursor) void setCursor(const QCursor &cursor, QWaylandScreen *screen); void setCursor(struct wl_buffer *buffer, struct ::wl_cursor_image *image, int bufferScale); void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size, int bufferScale); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot, int bufferScale); #endif void handleWindowDestroyed(QWaylandWindow *window); void handleEndDrag(); #if QT_CONFIG(wayland_datadevice) void setDataDevice(QWaylandDataDevice *device); QWaylandDataDevice *dataDevice() const; #endif void setTextInput(QWaylandTextInput *textInput); QWaylandTextInput *textInput() const; void removeMouseButtonFromState(Qt::MouseButton button); QWaylandWindow *pointerFocus() const; QWaylandWindow *keyboardFocus() const; QWaylandWindow *touchFocus() const; Qt::KeyboardModifiers modifiers() const; uint32_t serial() const; uint32_t cursorSerial() const; virtual Keyboard *createKeyboard(QWaylandInputDevice *device); virtual Pointer *createPointer(QWaylandInputDevice *device); virtual Touch *createTouch(QWaylandInputDevice *device); private: void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); QWaylandDisplay *mQDisplay = nullptr; struct wl_display *mDisplay = nullptr; int mVersion; uint32_t mCaps = 0; struct wl_surface *pointerSurface = nullptr; #if QT_CONFIG(wayland_datadevice) QWaylandDataDevice *mDataDevice = nullptr; #endif Keyboard *mKeyboard = nullptr; Pointer *mPointer = nullptr; Touch *mTouch = nullptr; QWaylandTextInput *mTextInput = nullptr; uint32_t mTime = 0; uint32_t mSerial = 0; void seat_capabilities(uint32_t caps) override; void handleTouchPoint(int id, double x, double y, Qt::TouchPointState state); QTouchDevice *mTouchDevice = nullptr; QSharedPointer mPixmapCursor; friend class QWaylandTouchExtension; friend class QWaylandQtKeyExtension; }; inline uint32_t QWaylandInputDevice::serial() const { return mSerial; } class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Keyboard : public QObject, public QtWayland::wl_keyboard { Q_OBJECT public: Keyboard(QWaylandInputDevice *p); ~Keyboard() override; void stopRepeat(); void keyboard_keymap(uint32_t format, int32_t fd, uint32_t size) override; void keyboard_enter(uint32_t time, struct wl_surface *surface, struct wl_array *keys) override; void keyboard_leave(uint32_t time, struct wl_surface *surface) override; void keyboard_key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) override; void keyboard_modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) override; QWaylandInputDevice *mParent = nullptr; QPointer mFocus; #if QT_CONFIG(xkbcommon_evdev) xkb_context *mXkbContext = nullptr; xkb_keymap *mXkbMap = nullptr; xkb_state *mXkbState = nullptr; xkb_compose_table *mXkbComposeTable = nullptr; xkb_compose_state *mXkbComposeState = nullptr; #endif uint32_t mNativeModifiers = 0; int mRepeatKey; uint32_t mRepeatCode; uint32_t mRepeatTime; QString mRepeatText; #if QT_CONFIG(xkbcommon_evdev) xkb_keysym_t mRepeatSym; #endif QTimer mRepeatTimer; Qt::KeyboardModifiers modifiers() const; private slots: void repeatKey(); private: #if QT_CONFIG(xkbcommon_evdev) bool createDefaultKeyMap(); void releaseKeyMap(); void createComposeState(); void releaseComposeState(); #endif }; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Pointer : public QtWayland::wl_pointer { public: Pointer(QWaylandInputDevice *p); ~Pointer() override; void pointer_enter(uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) override; void pointer_leave(uint32_t time, struct wl_surface *surface) override; void pointer_motion(uint32_t time, wl_fixed_t sx, wl_fixed_t sy) override; void pointer_button(uint32_t serial, uint32_t time, uint32_t button, uint32_t state) override; void pointer_axis(uint32_t time, uint32_t axis, wl_fixed_t value) override; void releaseButtons(); QWaylandInputDevice *mParent = nullptr; QPointer mFocus; uint32_t mEnterSerial = 0; #if QT_CONFIG(cursor) uint32_t mCursorSerial = 0; #endif QPointF mSurfacePos; QPointF mGlobalPos; Qt::MouseButtons mButtons = Qt::NoButton; #if QT_CONFIG(cursor) wl_buffer *mCursorBuffer = nullptr; Qt::CursorShape mCursorShape = Qt::BitmapCursor; #endif }; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Touch : public QtWayland::wl_touch { public: Touch(QWaylandInputDevice *p); ~Touch() override; void touch_down(uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y) override; void touch_up(uint32_t serial, uint32_t time, int32_t id) override; void touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) override; void touch_frame() override; void touch_cancel() override; bool allTouchPointsReleased(); void releasePoints(); QWaylandInputDevice *mParent = nullptr; QPointer mFocus; QList mTouchPoints; QList mPrevTouchPoints; }; class QWaylandPointerEvent { public: enum Type { Enter, Motion, Wheel }; inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, Qt::MouseButtons b, Qt::KeyboardModifiers m) : type(t) , timestamp(ts) , local(l) , global(g) , buttons(b) , modifiers(m) {} inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad, Qt::KeyboardModifiers m) : type(t) , timestamp(ts) , local(l) , global(g) , modifiers(m) , pixelDelta(pd) , angleDelta(ad) {} Type type; ulong timestamp; QPointF local; QPointF global; Qt::MouseButtons buttons; Qt::KeyboardModifiers modifiers; QPoint pixelDelta; QPoint angleDelta; }; } QT_END_NAMESPACE #endif qwaylandinputdeviceintegration_p.h000066400000000000000000000017241476226662200362020ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATION_H #define QWAYLANDINPUTDEVICEINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegration { public: QWaylandInputDeviceIntegration() {} virtual ~QWaylandInputDeviceIntegration() {} virtual QWaylandInputDevice *createInputDevice(QWaylandDisplay *d, int version, uint32_t id) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICEINTEGRATION_H qwaylandinputdeviceintegrationfactory_p.h000066400000000000000000000017341476226662200375730ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H #define QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandInputDeviceIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICENTEGRATIONFACTORY_H qwaylandinputdeviceintegrationplugin_p.h000066400000000000000000000023521476226662200374170ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H #define QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandInputDeviceIntegration; #define QWaylandInputDeviceIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandInputDeviceIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = nullptr); ~QWaylandInputDeviceIntegrationPlugin() override; virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H qwaylandintegration_p.h000066400000000000000000000076351476226662200337510ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPLATFORMINTEGRATION_WAYLAND_H #define QPLATFORMINTEGRATION_WAYLAND_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandBuffer; class QWaylandDisplay; class QWaylandClientBufferIntegration; class QWaylandServerBufferIntegration; class QWaylandShellIntegration; class QWaylandInputDeviceIntegration; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration { public: QWaylandIntegration(); ~QWaylandIntegration() override; bool hasFailed() { return mFailed; } bool hasCapability(QPlatformIntegration::Capability cap) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; #if QT_CONFIG(opengl) QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface() const override; #if QT_CONFIG(clipboard) QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; QVariant styleHint(StyleHint hint) const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; QWaylandDisplay *display() const; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id); virtual QWaylandClientBufferIntegration *clientBufferIntegration() const; virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; virtual QWaylandShellIntegration *shellIntegration() const; private: // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration. // Do not move this definition into the private section at the bottom. QScopedPointer mDisplay; protected: QScopedPointer mClientBufferIntegration; QScopedPointer mServerBufferIntegration; QScopedPointer mShellIntegration; QScopedPointer mInputDeviceIntegration; private: void initializeClientBufferIntegration(); void initializeServerBufferIntegration(); void initializeShellIntegration(); void initializeInputDeviceIntegration(); QWaylandShellIntegration *createShellIntegration(const QString& interfaceName); QScopedPointer mFontDb; #if QT_CONFIG(clipboard) QScopedPointer mClipboard; #endif #if QT_CONFIG(draganddrop) QScopedPointer mDrag; #endif QScopedPointer mNativeInterface; QScopedPointer mInputContext; #if QT_CONFIG(accessibility) QScopedPointer mAccessibility; #endif bool mFailed = false; bool mClientBufferIntegrationInitialized = false; bool mServerBufferIntegrationInitialized = false; bool mShellIntegrationInitialized = false; friend class QWaylandDisplay; }; } QT_END_NAMESPACE #endif qwaylandnativeinterface_p.h000066400000000000000000000041351476226662200345650ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDNATIVEINTERFACE_H #define QWAYLANDNATIVEINTERFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandIntegration; class QWaylandScreen; class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface { public: QWaylandNativeInterface(QWaylandIntegration *integration); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForScreen(const QByteArray &resourceString, QScreen *screen) override; #if QT_CONFIG(opengl) void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; #endif QVariantMap windowProperties(QPlatformWindow *window) const override; QVariant windowProperty(QPlatformWindow *window, const QString &name) const override; QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override; void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override; void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); QFunctionPointer platformFunction(const QByteArray &resource) const override; private: QWaylandIntegration *m_integration = nullptr; QHash m_windowProperties; static void setSync(QWindow *window); static void setDeSync(QWindow *window); static bool isSync(QWindow *window); }; } QT_END_NAMESPACE #endif // QWAYLANDNATIVEINTERFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandqtkey_p.h000066400000000000000000000026031476226662200326300ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDQTKEY_H #define QWAYLANDQTKEY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandQtKeyExtension : public QtWayland::zqt_key_v1 { public: QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); private: QWaylandDisplay *m_display = nullptr; void zqt_key_v1_key(struct wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const QString &text, uint32_t autorep, uint32_t count) override; }; } QT_END_NAMESPACE #endif // QWAYLANDQTKEY_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandscreen_p.h000066400000000000000000000064011476226662200327520ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSCREEN_H #define QWAYLANDSCREEN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandCursor; class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output, QtWayland::zxdg_output_v1 { public: QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id); ~QWaylandScreen() override; void initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager); QWaylandDisplay *display() const; QString manufacturer() const override; QString model() const override; QRect geometry() const override; int depth() const override; QImage::Format format() const override; QSizeF physicalSize() const override; QDpi logicalDpi() const override; QList virtualSiblings() const override; void setOrientationUpdateMask(Qt::ScreenOrientations mask) override; Qt::ScreenOrientation orientation() const override; int scale() const; qreal devicePixelRatio() const override; qreal refreshRate() const override; QString name() const override { return mOutputName; } #if QT_CONFIG(cursor) QPlatformCursor *cursor() const override; QWaylandCursor *waylandCursor(); #endif uint32_t outputId() const { return m_outputId; } ::wl_output *output() { return QtWayland::wl_output::object(); } static QWaylandScreen *waylandScreenFromWindow(QWindow *window); static QWaylandScreen *fromWlOutput(::wl_output *output); private: void output_mode(uint32_t flags, int width, int height, int refresh) override; void output_geometry(int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const QString &make, const QString &model, int32_t transform) override; void output_scale(int32_t factor) override; void output_done() override; // XdgOutput void zxdg_output_v1_logical_position(int32_t x, int32_t y) override; void zxdg_output_v1_logical_size(int32_t width, int32_t height) override; void zxdg_output_v1_done() override; int m_outputId; QWaylandDisplay *mWaylandDisplay = nullptr; QString mManufacturer; QString mModel; QRect mGeometry; QRect mXdgGeometry; int mScale = 1; int mDepth = 32; int mRefreshRate = 60000; int mTransform = -1; QImage::Format mFormat = QImage::Format_ARGB32_Premultiplied; QSize mPhysicalSize; QString mOutputName; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; #if QT_CONFIG(cursor) QScopedPointer mWaylandCursor; #endif }; } QT_END_NAMESPACE #endif // QWAYLANDSCREEN_H qwaylandserverbufferintegration_p.h000066400000000000000000000027421476226662200363640ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATION_H #define QWAYLANDSERVERBUFFERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE class QOpenGLTexture; namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer { public: enum Format { RGBA32, A8 }; QWaylandServerBuffer(); virtual ~QWaylandServerBuffer(); virtual QOpenGLTexture *toOpenGlTexture() = 0; Format format() const; QSize size() const; void setUserData(void *userData); void *userData() const; protected: Format m_format; QSize m_size; private: void *m_user_data = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration { public: QWaylandServerBufferIntegration(); virtual ~QWaylandServerBufferIntegration(); virtual void initialize(QWaylandDisplay *display) = 0; virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0; }; } QT_END_NAMESPACE #endif qwaylandserverbufferintegrationfactory_p.h000066400000000000000000000017441476226662200377550ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H #define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandServerBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H qwaylandserverbufferintegrationplugin_p.h000066400000000000000000000023651476226662200376040ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandServerBufferIntegration; #define QWaylandServerBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandServerBufferIntegrationPlugin() override; virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H qwaylandshellintegration_p.h000066400000000000000000000030111476226662200347610ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATION_H #define QWAYLANDSHELLINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandShellSurface; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegration { public: QWaylandShellIntegration() {} virtual ~QWaylandShellIntegration() {} virtual bool initialize(QWaylandDisplay *display) { m_display = display; return true; } virtual QWaylandShellSurface *createShellSurface(QWaylandWindow *window) = 0; virtual void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) { if (newFocus) m_display->handleWindowActivated(newFocus); if (oldFocus) m_display->handleWindowDeactivated(oldFocus); } virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) { Q_UNUSED(resource); Q_UNUSED(window); return nullptr; } protected: QWaylandDisplay *m_display = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATION_H qwaylandshellintegrationfactory_p.h000066400000000000000000000020231476226662200363530ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATIONFACTORY_H #define QWAYLANDSHELLINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandShellIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATIONFACTORY_H qwaylandshellintegrationplugin_p.h000066400000000000000000000022451476226662200362100ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATIONPLUGIN_H #define QWAYLANDSHELLINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandShellIntegration; #define QWaylandShellIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandShellIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandShellIntegrationPlugin(QObject *parent = nullptr); ~QWaylandShellIntegrationPlugin() override; virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATIONPLUGIN_H qwaylandshellsurface_p.h000066400000000000000000000037271476226662200341040ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2021 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLSURFACE_H #define QWAYLANDSHELLSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE class QVariant; class QWindow; namespace QtWaylandClient { class QWaylandWindow; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QObject { Q_OBJECT public: explicit QWaylandShellSurface(QWaylandWindow *window); ~QWaylandShellSurface() override {} virtual void resize(QWaylandInputDevice * /*inputDevice*/, enum wl_shell_surface_resize /*edges*/) {} virtual bool move(QWaylandInputDevice *) { return false; } virtual void setTitle(const QString & /*title*/) {} virtual void setAppId(const QString & /*appId*/) {} virtual void setWindowFlags(Qt::WindowFlags flags); virtual bool isExposed() const { return true; } virtual bool handleExpose(const QRegion &) { return false; } virtual void raise() {} virtual void lower() {} virtual void setContentOrientationMask(Qt::ScreenOrientations orientation) { Q_UNUSED(orientation) } virtual void sendProperty(const QString &name, const QVariant &value); inline QWaylandWindow *window() { return m_window; } virtual void applyConfigure() {} virtual void requestWindowStates(Qt::WindowStates states) {Q_UNUSED(states);} virtual bool wantsDecorations() const { return false; } private: QWaylandWindow *m_window = nullptr; friend class QWaylandWindow; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLSURFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandshm_p.h000066400000000000000000000022671476226662200322700ustar00rootroot00000000000000// Copyright (C) 2016 LG Electronics Inc, author: // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHM_H #define QWAYLANDSHM_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandShm : public QtWayland::wl_shm { public: QWaylandShm(QWaylandDisplay *display, int version, uint32_t id); ~QWaylandShm() override; bool formatSupported(wl_shm_format format) const; bool formatSupported(QImage::Format format) const; static wl_shm_format formatFrom(QImage::Format format); static QImage::Format formatFrom(wl_shm_format format); protected: void shm_format(uint32_t format) override; private: QVector m_formats; }; } QT_END_NAMESPACE #endif qwaylandshmbackingstore_p.h000066400000000000000000000051731476226662200346040ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHMBACKINGSTORE_H #define QWAYLANDSHMBACKINGSTORE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandAbstractDecoration; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer { public: QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale = 1); ~QWaylandShmBuffer() override; QSize size() const override { return mImage.size(); } int scale() const override { return int(mImage.devicePixelRatio()); } QImage *image() { return &mImage; } QImage *imageInsideMargins(const QMargins &margins); private: QImage mImage; struct wl_shm_pool *mShmPool = nullptr; QMargins mMargins; QImage *mMarginsImage = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore { public: QWaylandShmBackingStore(QWindow *window); ~QWaylandShmBackingStore() override; QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; void resize(const QSize &size, const QRegion &staticContents) override; void resize(const QSize &size); void beginPaint(const QRegion ®ion) override; void endPaint() override; QWaylandAbstractDecoration *windowDecoration() const; QMargins windowDecorationMargins() const; QImage *entireSurface() const; QImage *contentSurface() const; void ensureSize(); QWaylandWindow *waylandWindow() const; void iterateBuffer(); #if QT_CONFIG(opengl) QImage toImage() const override; #endif private: void updateDecorations(); QWaylandShmBuffer *getBuffer(const QSize &size); QWaylandDisplay *mDisplay = nullptr; QLinkedList mBuffers; QWaylandShmBuffer *mFrontBuffer = nullptr; QWaylandShmBuffer *mBackBuffer = nullptr; bool mPainting = false; bool mPendingFlush = false; QRegion mPendingRegion; QMutex mMutex; QSize mRequestedSize; Qt::WindowFlags mCurrentWindowFlags; }; } QT_END_NAMESPACE #endif qwaylandshmwindow_p.h000066400000000000000000000015611476226662200334350ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHMWINDOW_H #define QWAYLANDSHMWINDOW_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandShmWindow : public QWaylandWindow { public: QWaylandShmWindow(QWindow *window); ~QWaylandShmWindow() override; WindowType windowType() const override; QSurfaceFormat format() const override { return QSurfaceFormat(); } }; } QT_END_NAMESPACE #endif // QWAYLANDSHMWINDOW_H qwaylandsubsurface_p.h000066400000000000000000000030111476226662200335500ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSUBSURFACE_H #define QWAYLANDSUBSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandSubSurface : public QtWayland::wl_subsurface { public: QWaylandSubSurface(QWaylandWindow *window, QWaylandWindow *parent, ::wl_subsurface *subsurface); ~QWaylandSubSurface() override; QWaylandWindow *window() const { return m_window; } QWaylandWindow *parent() const { return m_parent; } void setSync(); void setDeSync(); bool isSync() const { return m_synchronized; } QMutex *syncMutex() { return &m_syncLock; } private: // Intentionally hide public methods from ::wl_subsurface // to keep track of the sync state void set_sync(); void set_desync(); QWaylandWindow *m_window = nullptr; QWaylandWindow *m_parent = nullptr; bool m_synchronized = false; QMutex m_syncLock; }; QT_END_NAMESPACE } #endif // QWAYLANDSUBSURFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandtouch_p.h000066400000000000000000000042101476226662200326110ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDTOUCH_H #define QWAYLANDTOUCH_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandTouchExtension : public QtWayland::qt_touch_extension { public: QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id); void touchCanceled(); private: void registerDevice(int caps); QWaylandDisplay *mDisplay = nullptr; void touch_extension_touch(uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, struct wl_array *rawdata) override; void touch_extension_configure(uint32_t flags) override; void sendTouchEvent(); QList mTouchPoints; QList mPrevTouchPoints; QTouchDevice *mTouchDevice = nullptr; uint32_t mTimestamp; int mPointsLeft; uint32_t mFlags; int mMouseSourceId; QPointF mLastMouseLocal; QPointF mLastMouseGlobal; QWindow *mTargetWindow = nullptr; QWaylandInputDevice *mInputDevice = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDTOUCH_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandwindow_p.h000066400000000000000000000157651476226662200330170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWINDOW_H #define QWAYLANDWINDOW_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include struct wl_egl_window; QT_BEGIN_NAMESPACE namespace QtWaylandClient { Q_DECLARE_LOGGING_CATEGORY(lcWaylandBackingstore) class QWaylandDisplay; class QWaylandBuffer; class QWaylandShellSurface; class QWaylandSubSurface; class QWaylandAbstractDecoration; class QWaylandInputDevice; class QWaylandScreen; class QWaylandShmBackingStore; class QWaylandPointerEvent; class Q_WAYLAND_CLIENT_EXPORT QWaylandWindow : public QObject, public QPlatformWindow, public QtWayland::wl_surface { Q_OBJECT public: enum WindowType { Shm, Egl }; QWaylandWindow(QWindow *window); ~QWaylandWindow() override; virtual WindowType windowType() const = 0; virtual void ensureSize(); WId winId() const override; void setVisible(bool visible) override; void setParent(const QPlatformWindow *parent) override; void setWindowTitle(const QString &title) override; inline QIcon windowIcon() const; void setWindowIcon(const QIcon &icon) override; void setGeometry(const QRect &rect) override; void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset = {0, 0}); void applyConfigureWhenPossible(); //rename to possible? using QtWayland::wl_surface::attach; void attach(QWaylandBuffer *buffer, int x, int y); void attachOffset(QWaylandBuffer *buffer); QPoint attachOffset() const; using QtWayland::wl_surface::damage; void damage(const QRect &rect); void commit(QWaylandBuffer *buffer, const QRegion &damage); void waitForFrameSync(); QMargins frameMargins() const override; QSize surfaceSize() const; QRect windowGeometry() const; static QWaylandWindow *fromWlSurface(::wl_surface *surface); QWaylandDisplay *display() const { return mDisplay; } QWaylandShellSurface *shellSurface() const; QWaylandSubSurface *subSurfaceWindow() const; QWaylandScreen *waylandScreen() const; void handleContentOrientationChange(Qt::ScreenOrientation orientation) override; void setOrientationMask(Qt::ScreenOrientations mask); void setWindowState(Qt::WindowStates states) override; void setWindowFlags(Qt::WindowFlags flags) override; void handleWindowStatesChanged(Qt::WindowStates states); void raise() override; void lower() override; void setMask(const QRegion ®ion) override; int scale() const; qreal devicePixelRatio() const override; void requestActivateWindow() override; bool isExposed() const override; void unfocus(); QWaylandAbstractDecoration *decoration() const; void handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); void handleMouseLeave(QWaylandInputDevice *inputDevice); bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods); bool createDecoration(); #if QT_CONFIG(cursor) void setMouseCursor(QWaylandInputDevice *device, const QCursor &cursor); void restoreMouseCursor(QWaylandInputDevice *device); #endif QWaylandWindow *transientParent() const; QMutex *resizeMutex() { return &mResizeLock; } void doApplyConfigure(); void setCanResize(bool canResize); bool setMouseGrabEnabled(bool grab) override; static QWaylandWindow *mouseGrab() { return mMouseGrab; } void sendProperty(const QString &name, const QVariant &value); void setProperty(const QString &name, const QVariant &value); QVariantMap properties() const; QVariant property(const QString &name); QVariant property(const QString &name, const QVariant &defaultValue); void setBackingStore(QWaylandShmBackingStore *backingStore) { mBackingStore = backingStore; } QWaylandShmBackingStore *backingStore() const { return mBackingStore; } bool setKeyboardGrabEnabled(bool) override { return false; } void propagateSizeHints() override { } void addAttachOffset(const QPoint point); bool startSystemMove(const QPoint &pos) override; void requestUpdate() override; public slots: void applyConfigure(); protected: void surface_enter(struct ::wl_output *output) override; void surface_leave(struct ::wl_output *output) override; QVector mScreens; //As seen by wl_surface.enter/leave events. Chronological order. QWaylandDisplay *mDisplay = nullptr; QWaylandShellSurface *mShellSurface = nullptr; QWaylandSubSurface *mSubSurfaceWindow = nullptr; QVector mChildren; QWaylandAbstractDecoration *mWindowDecoration = nullptr; bool mMouseEventsInContentArea = false; Qt::MouseButtons mMousePressedInContentArea = Qt::NoButton; WId mWindowId; bool mWaitingForFrameSync = false; struct ::wl_callback *mFrameCallback = nullptr; QWaitCondition mFrameSyncWait; QMutex mResizeLock; bool mWaitingToApplyConfigure = false; bool mCanResize = true; bool mResizeDirty = false; bool mResizeAfterSwap; QVariantMap m_properties; bool mSentInitialResize = false; QPoint mOffset; int mScale = 1; QIcon mWindowIcon; Qt::WindowFlags mFlags; QRegion mMask; Qt::WindowStates mLastReportedWindowStates = Qt::WindowNoState; QWaylandShmBackingStore *mBackingStore = nullptr; private slots: void handleScreenRemoved(QScreen *qScreen); private: void setGeometry_helper(const QRect &rect); void initWindow(); void initializeWlSurface(); bool shouldCreateShellSurface() const; bool shouldCreateSubSurface() const; void reset(bool sendDestroyEvent = true); void sendExposeEvent(const QRect &rect); static void closePopups(QWaylandWindow *parent); QWaylandScreen *calculateScreenFromSurfaceEvents() const; void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); void handleScreenChanged(); bool mUpdateRequested = false; static const wl_callback_listener callbackListener; static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); static QMutex mFrameSyncMutex; static QWaylandWindow *mMouseGrab; friend class QWaylandSubSurface; }; inline QIcon QWaylandWindow::windowIcon() const { return mWindowIcon; } inline QPoint QWaylandWindow::attachOffset() const { return mOffset; } } QT_END_NAMESPACE #endif // QWAYLANDWINDOW_H qwaylandwindowmanagerintegration_p.h000066400000000000000000000034251476226662200365250ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H #define QWAYLANDWINDOWMANAGERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandWindowManagerIntegrationPrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QGenericUnixServices, public QtWayland::qt_windowmanager { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration) public: explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay); ~QWaylandWindowManagerIntegration() override; bool openUrl(const QUrl &url) override; bool openDocument(const QUrl &url) override; bool showIsFullScreen() const; private: static void wlHandleListenerGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); QScopedPointer d_ptr; void windowmanager_hints(int32_t showIsFullScreen) override; void windowmanager_quit() override; void openUrl_helper(const QUrl &url); }; QT_END_NAMESPACE } #endif // QWAYLANDWINDOWMANAGERINTEGRATION_H qwaylandwlshellintegration_p.h000066400000000000000000000021131476226662200353260ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWLSHELLINTEGRATION_P_H #define QWAYLANDWLSHELLINTEGRATION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellIntegration : public QWaylandShellIntegration { public: static QWaylandWlShellIntegration *create(QWaylandDisplay* display); bool initialize(QWaylandDisplay *) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; private: QWaylandWlShellIntegration(QWaylandDisplay* display); QtWayland::wl_shell *m_wlShell = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDWLSHELLINTEGRATION_P_H qwaylandxdgshellv6integration_p.h000066400000000000000000000021521476226662200357450ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDXDGSHELLV6INTEGRATION_P_H #define QWAYLANDXDGSHELLV6INTEGRATION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandXdgShellV6; class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellV6Integration : public QWaylandShellIntegration { public: static QWaylandXdgShellV6Integration *create(QWaylandDisplay* display); bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; private: QWaylandXdgShellV6Integration(QWaylandDisplay *display); QWaylandXdgShellV6 *m_xdgShell = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDXDGSHELLV6INTEGRATION_P_H wayland-hardware-integration-client-protocol.h000066400000000000000000000115661476226662200402320ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef HARDWARE_INTEGRATION_CLIENT_PROTOCOL_H #define HARDWARE_INTEGRATION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_hardware_integration The hardware_integration protocol * @section page_ifaces_hardware_integration Interfaces * - @subpage page_iface_qt_hardware_integration - compostors communicates supported buffer sharing extensions * @section page_copyright_hardware_integration Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_hardware_integration; /** * @page page_iface_qt_hardware_integration qt_hardware_integration * @section page_iface_qt_hardware_integration_desc Description * * Using this protocol the compositor can signal to clients which buffer sharing extensions * the client should use * @section page_iface_qt_hardware_integration_api API * See @ref iface_qt_hardware_integration. */ /** * @defgroup iface_qt_hardware_integration The qt_hardware_integration interface * * Using this protocol the compositor can signal to clients which buffer sharing extensions * the client should use */ extern const struct wl_interface qt_hardware_integration_interface; /** * @ingroup iface_qt_hardware_integration * @struct qt_hardware_integration_listener */ struct qt_hardware_integration_listener { /** */ void (*client_backend)(void *data, struct qt_hardware_integration *qt_hardware_integration, const char *name); /** */ void (*server_backend)(void *data, struct qt_hardware_integration *qt_hardware_integration, const char *name); }; /** * @ingroup iface_qt_hardware_integration */ static inline int qt_hardware_integration_add_listener(struct qt_hardware_integration *qt_hardware_integration, const struct qt_hardware_integration_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_hardware_integration, (void (**)(void)) listener, data); } /** * @ingroup iface_qt_hardware_integration */ #define QT_HARDWARE_INTEGRATION_CLIENT_BACKEND_SINCE_VERSION 1 /** * @ingroup iface_qt_hardware_integration */ #define QT_HARDWARE_INTEGRATION_SERVER_BACKEND_SINCE_VERSION 1 /** @ingroup iface_qt_hardware_integration */ static inline void qt_hardware_integration_set_user_data(struct qt_hardware_integration *qt_hardware_integration, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_hardware_integration, user_data); } /** @ingroup iface_qt_hardware_integration */ static inline void * qt_hardware_integration_get_user_data(struct qt_hardware_integration *qt_hardware_integration) { return wl_proxy_get_user_data((struct wl_proxy *) qt_hardware_integration); } static inline uint32_t qt_hardware_integration_get_version(struct qt_hardware_integration *qt_hardware_integration) { return wl_proxy_get_version((struct wl_proxy *) qt_hardware_integration); } /** @ingroup iface_qt_hardware_integration */ static inline void qt_hardware_integration_destroy(struct qt_hardware_integration *qt_hardware_integration) { wl_proxy_destroy((struct wl_proxy *) qt_hardware_integration); } #ifdef __cplusplus } #endif #endif wayland-qt-key-unstable-v1-client-protocol.h000066400000000000000000000125371476226662200374640ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef QT_KEY_UNSTABLE_V1_CLIENT_PROTOCOL_H #define QT_KEY_UNSTABLE_V1_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_qt_key_unstable_v1 The qt_key_unstable_v1 protocol * @section page_ifaces_qt_key_unstable_v1 Interfaces * - @subpage page_iface_zqt_key_v1 - send serialized QKeyEvents * @section page_copyright_qt_key_unstable_v1 Copyright *
 *
 * Copyright (C) 2018 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct wl_surface; struct zqt_key_v1; /** * @page page_iface_zqt_key_v1 zqt_key_v1 * @section page_iface_zqt_key_v1_desc Description * * This protocol is independent of the Wayland seat concept. Its * intention is to let a QKeyEvent be transferred from a Qt compositor * to a Qt client without losing or adding false information by going * through wl_seat and wl_keyboard. * * Note: This protocol is considered private to Qt. We will do our * best to bump version numbers when we make backwards compatible * changes, bump the protocol name and interface suffixes when we make * backwards incompatible changes, but we provide no guarantees. We * may also remove the protocol without warning. Implement this at * your own risk. * @section page_iface_zqt_key_v1_api API * See @ref iface_zqt_key_v1. */ /** * @defgroup iface_zqt_key_v1 The zqt_key_v1 interface * * This protocol is independent of the Wayland seat concept. Its * intention is to let a QKeyEvent be transferred from a Qt compositor * to a Qt client without losing or adding false information by going * through wl_seat and wl_keyboard. * * Note: This protocol is considered private to Qt. We will do our * best to bump version numbers when we make backwards compatible * changes, bump the protocol name and interface suffixes when we make * backwards incompatible changes, but we provide no guarantees. We * may also remove the protocol without warning. Implement this at * your own risk. */ extern const struct wl_interface zqt_key_v1_interface; /** * @ingroup iface_zqt_key_v1 * @struct zqt_key_v1_listener */ struct zqt_key_v1_listener { /** * send key event * * The key event notifies the client that a QKeyEvent has * occurred on the server side. */ void (*key)(void *data, struct zqt_key_v1 *zqt_key_v1, struct wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const char *text, uint32_t autorepeat, uint32_t count); }; /** * @ingroup iface_zqt_key_v1 */ static inline int zqt_key_v1_add_listener(struct zqt_key_v1 *zqt_key_v1, const struct zqt_key_v1_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zqt_key_v1, (void (**)(void)) listener, data); } /** * @ingroup iface_zqt_key_v1 */ #define ZQT_KEY_V1_KEY_SINCE_VERSION 1 /** @ingroup iface_zqt_key_v1 */ static inline void zqt_key_v1_set_user_data(struct zqt_key_v1 *zqt_key_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zqt_key_v1, user_data); } /** @ingroup iface_zqt_key_v1 */ static inline void * zqt_key_v1_get_user_data(struct zqt_key_v1 *zqt_key_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zqt_key_v1); } static inline uint32_t zqt_key_v1_get_version(struct zqt_key_v1 *zqt_key_v1) { return wl_proxy_get_version((struct wl_proxy *) zqt_key_v1); } /** @ingroup iface_zqt_key_v1 */ static inline void zqt_key_v1_destroy(struct zqt_key_v1 *zqt_key_v1) { wl_proxy_destroy((struct wl_proxy *) zqt_key_v1); } #ifdef __cplusplus } #endif #endif wayland-qt-windowmanager-client-protocol.h000066400000000000000000000113371476226662200373740ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef QT_WINDOWMANAGER_CLIENT_PROTOCOL_H #define QT_WINDOWMANAGER_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_qt_windowmanager The qt_windowmanager protocol * @section page_ifaces_qt_windowmanager Interfaces * - @subpage page_iface_qt_windowmanager - * @section page_copyright_qt_windowmanager Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_windowmanager; /** * @page page_iface_qt_windowmanager qt_windowmanager * @section page_iface_qt_windowmanager_api API * See @ref iface_qt_windowmanager. */ /** * @defgroup iface_qt_windowmanager The qt_windowmanager interface */ extern const struct wl_interface qt_windowmanager_interface; /** * @ingroup iface_qt_windowmanager * @struct qt_windowmanager_listener */ struct qt_windowmanager_listener { /** */ void (*hints)(void *data, struct qt_windowmanager *qt_windowmanager, int32_t show_is_fullscreen); /** */ void (*quit)(void *data, struct qt_windowmanager *qt_windowmanager); }; /** * @ingroup iface_qt_windowmanager */ static inline int qt_windowmanager_add_listener(struct qt_windowmanager *qt_windowmanager, const struct qt_windowmanager_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_windowmanager, (void (**)(void)) listener, data); } #define QT_WINDOWMANAGER_OPEN_URL 0 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_HINTS_SINCE_VERSION 1 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_QUIT_SINCE_VERSION 1 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_OPEN_URL_SINCE_VERSION 1 /** @ingroup iface_qt_windowmanager */ static inline void qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data); } /** @ingroup iface_qt_windowmanager */ static inline void * qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager) { return wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager); } static inline uint32_t qt_windowmanager_get_version(struct qt_windowmanager *qt_windowmanager) { return wl_proxy_get_version((struct wl_proxy *) qt_windowmanager); } /** @ingroup iface_qt_windowmanager */ static inline void qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager) { wl_proxy_destroy((struct wl_proxy *) qt_windowmanager); } /** * @ingroup iface_qt_windowmanager * * If remaining is not 0 this is a multipart request, and * the server must concatenate subsequent requst urls to and * including a request where remaining is set to 0, before * it can handle the url. */ static inline void qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url) { wl_proxy_marshal((struct wl_proxy *) qt_windowmanager, QT_WINDOWMANAGER_OPEN_URL, remaining, url); } #ifdef __cplusplus } #endif #endif wayland-server-buffer-extension-client-protocol.h000066400000000000000000000106371476226662200407010ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef SERVER_BUFFER_EXTENSION_CLIENT_PROTOCOL_H #define SERVER_BUFFER_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_server_buffer_extension The server_buffer_extension protocol * @section page_ifaces_server_buffer_extension Interfaces * - @subpage page_iface_qt_server_buffer - buffers managed by the compositor * @section page_copyright_server_buffer_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_server_buffer; /** * @page page_iface_qt_server_buffer qt_server_buffer * @section page_iface_qt_server_buffer_desc Description * * Server buffer is an extension which makes it possible to share a * buffer created by the compositor to share it with arbitrary * clients. These types of buffers are intended to be read only * buffers for clients, but this is an implementation detail. * * Server buffers main purpose is to help implement caches * @section page_iface_qt_server_buffer_api API * See @ref iface_qt_server_buffer. */ /** * @defgroup iface_qt_server_buffer The qt_server_buffer interface * * Server buffer is an extension which makes it possible to share a * buffer created by the compositor to share it with arbitrary * clients. These types of buffers are intended to be read only * buffers for clients, but this is an implementation detail. * * Server buffers main purpose is to help implement caches */ extern const struct wl_interface qt_server_buffer_interface; #define QT_SERVER_BUFFER_RELEASE 0 /** * @ingroup iface_qt_server_buffer */ #define QT_SERVER_BUFFER_RELEASE_SINCE_VERSION 1 /** @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_set_user_data(struct qt_server_buffer *qt_server_buffer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_server_buffer, user_data); } /** @ingroup iface_qt_server_buffer */ static inline void * qt_server_buffer_get_user_data(struct qt_server_buffer *qt_server_buffer) { return wl_proxy_get_user_data((struct wl_proxy *) qt_server_buffer); } static inline uint32_t qt_server_buffer_get_version(struct qt_server_buffer *qt_server_buffer) { return wl_proxy_get_version((struct wl_proxy *) qt_server_buffer); } /** @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_destroy(struct qt_server_buffer *qt_server_buffer) { wl_proxy_destroy((struct wl_proxy *) qt_server_buffer); } /** * @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_release(struct qt_server_buffer *qt_server_buffer) { wl_proxy_marshal((struct wl_proxy *) qt_server_buffer, QT_SERVER_BUFFER_RELEASE); } #ifdef __cplusplus } #endif #endif wayland-surface-extension-client-protocol.h000066400000000000000000000225161476226662200375530ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef SURFACE_EXTENSION_CLIENT_PROTOCOL_H #define SURFACE_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_surface_extension The surface_extension protocol * @section page_ifaces_surface_extension Interfaces * - @subpage page_iface_qt_surface_extension - * - @subpage page_iface_qt_extended_surface - * @section page_copyright_surface_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_extended_surface; struct qt_surface_extension; struct wl_surface; /** * @page page_iface_qt_surface_extension qt_surface_extension * @section page_iface_qt_surface_extension_api API * See @ref iface_qt_surface_extension. */ /** * @defgroup iface_qt_surface_extension The qt_surface_extension interface */ extern const struct wl_interface qt_surface_extension_interface; /** * @page page_iface_qt_extended_surface qt_extended_surface * @section page_iface_qt_extended_surface_api API * See @ref iface_qt_extended_surface. */ /** * @defgroup iface_qt_extended_surface The qt_extended_surface interface */ extern const struct wl_interface qt_extended_surface_interface; #define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE 0 /** * @ingroup iface_qt_surface_extension */ #define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE_SINCE_VERSION 1 /** @ingroup iface_qt_surface_extension */ static inline void qt_surface_extension_set_user_data(struct qt_surface_extension *qt_surface_extension, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_surface_extension, user_data); } /** @ingroup iface_qt_surface_extension */ static inline void * qt_surface_extension_get_user_data(struct qt_surface_extension *qt_surface_extension) { return wl_proxy_get_user_data((struct wl_proxy *) qt_surface_extension); } static inline uint32_t qt_surface_extension_get_version(struct qt_surface_extension *qt_surface_extension) { return wl_proxy_get_version((struct wl_proxy *) qt_surface_extension); } /** @ingroup iface_qt_surface_extension */ static inline void qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension) { wl_proxy_destroy((struct wl_proxy *) qt_surface_extension); } /** * @ingroup iface_qt_surface_extension */ static inline struct qt_extended_surface * qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) qt_surface_extension, QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, &qt_extended_surface_interface, NULL, surface); return (struct qt_extended_surface *) id; } #ifndef QT_EXTENDED_SURFACE_ORIENTATION_ENUM #define QT_EXTENDED_SURFACE_ORIENTATION_ENUM enum qt_extended_surface_orientation { QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION = 0, QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION = 1, QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION = 2, QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION = 4, QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION = 8, }; #endif /* QT_EXTENDED_SURFACE_ORIENTATION_ENUM */ #ifndef QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM #define QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM enum qt_extended_surface_windowflag { QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES = 1, QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP = 2, QT_EXTENDED_SURFACE_WINDOWFLAG_BYPASSWINDOWMANAGER = 4, }; #endif /* QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM */ /** * @ingroup iface_qt_extended_surface * @struct qt_extended_surface_listener */ struct qt_extended_surface_listener { /** */ void (*onscreen_visibility)(void *data, struct qt_extended_surface *qt_extended_surface, int32_t visible); /** */ void (*set_generic_property)(void *data, struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value); /** */ void (*close)(void *data, struct qt_extended_surface *qt_extended_surface); }; /** * @ingroup iface_qt_extended_surface */ static inline int qt_extended_surface_add_listener(struct qt_extended_surface *qt_extended_surface, const struct qt_extended_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_extended_surface, (void (**)(void)) listener, data); } #define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY 0 #define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK 1 #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS 2 #define QT_EXTENDED_SURFACE_RAISE 3 #define QT_EXTENDED_SURFACE_LOWER 4 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_ONSCREEN_VISIBILITY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_GENERIC_PROPERTY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_CLOSE_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_RAISE_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_LOWER_SINCE_VERSION 1 /** @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data); } /** @ingroup iface_qt_extended_surface */ static inline void * qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface) { return wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface); } static inline uint32_t qt_extended_surface_get_version(struct qt_extended_surface *qt_extended_surface) { return wl_proxy_get_version((struct wl_proxy *) qt_extended_surface); } /** @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface) { wl_proxy_destroy((struct wl_proxy *) qt_extended_surface); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_content_orientation_mask(struct qt_extended_surface *qt_extended_surface, int32_t orientation) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK, orientation); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_raise(struct qt_extended_surface *qt_extended_surface) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_RAISE); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_lower(struct qt_extended_surface *qt_extended_surface) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_LOWER); } #ifdef __cplusplus } #endif #endif wayland-text-input-unstable-v2-client-protocol.h000066400000000000000000000730621476226662200403740ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef TEXT_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H #define TEXT_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_text_input_unstable_v2 The text_input_unstable_v2 protocol * @section page_ifaces_text_input_unstable_v2 Interfaces * - @subpage page_iface_zwp_text_input_v2 - text input * - @subpage page_iface_zwp_text_input_manager_v2 - text input manager * @section page_copyright_text_input_unstable_v2 Copyright *
 *
 * Copyright © 2012, 2013 Intel Corporation
 * Copyright © 2015, 2016 Jan Arne Petersen
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * 
*/ struct wl_seat; struct wl_surface; struct zwp_text_input_manager_v2; struct zwp_text_input_v2; /** * @page page_iface_zwp_text_input_v2 zwp_text_input_v2 * @section page_iface_zwp_text_input_v2_desc Description * * The zwp_text_input_v2 interface represents text input and input methods * associated with a seat. It provides enter/leave events to follow the * text input focus for a seat. * * Requests are used to enable/disable the text-input object and set * state information like surrounding and selected text or the content type. * The information about the entered text is sent to the text-input object * via the pre-edit and commit events. Using this interface removes the need * for applications to directly process hardware key events and compose text * out of them. * * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices * have to always point to the first byte of an UTF-8 encoded code point. * Lengths are not allowed to contain just a part of an UTF-8 encoded code * point. * * State is sent by the state requests (set_surrounding_text, * set_content_type, set_cursor_rectangle and set_preferred_language) and * an update_state request. After an enter or an input_method_change event * all state information is invalidated and needs to be resent from the * client. A reset or entering a new widget on client side also * invalidates all current state information. * @section page_iface_zwp_text_input_v2_api API * See @ref iface_zwp_text_input_v2. */ /** * @defgroup iface_zwp_text_input_v2 The zwp_text_input_v2 interface * * The zwp_text_input_v2 interface represents text input and input methods * associated with a seat. It provides enter/leave events to follow the * text input focus for a seat. * * Requests are used to enable/disable the text-input object and set * state information like surrounding and selected text or the content type. * The information about the entered text is sent to the text-input object * via the pre-edit and commit events. Using this interface removes the need * for applications to directly process hardware key events and compose text * out of them. * * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices * have to always point to the first byte of an UTF-8 encoded code point. * Lengths are not allowed to contain just a part of an UTF-8 encoded code * point. * * State is sent by the state requests (set_surrounding_text, * set_content_type, set_cursor_rectangle and set_preferred_language) and * an update_state request. After an enter or an input_method_change event * all state information is invalidated and needs to be resent from the * client. A reset or entering a new widget on client side also * invalidates all current state information. */ extern const struct wl_interface zwp_text_input_v2_interface; /** * @page page_iface_zwp_text_input_manager_v2 zwp_text_input_manager_v2 * @section page_iface_zwp_text_input_manager_v2_desc Description * * A factory for text-input objects. This object is a global singleton. * @section page_iface_zwp_text_input_manager_v2_api API * See @ref iface_zwp_text_input_manager_v2. */ /** * @defgroup iface_zwp_text_input_manager_v2 The zwp_text_input_manager_v2 interface * * A factory for text-input objects. This object is a global singleton. */ extern const struct wl_interface zwp_text_input_manager_v2_interface; #ifndef ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM #define ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM /** * @ingroup iface_zwp_text_input_v2 * content hint * * Content hint is a bitmask to allow to modify the behavior of the text * input. */ enum zwp_text_input_v2_content_hint { /** * no special behaviour */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_NONE = 0x0, /** * suggest word completions */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_COMPLETION = 0x1, /** * suggest word corrections */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CORRECTION = 0x2, /** * switch to uppercase letters at the start of a sentence */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4, /** * prefer lowercase letters */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_LOWERCASE = 0x8, /** * prefer uppercase letters */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_UPPERCASE = 0x10, /** * prefer casing for titles and headings (can be language dependent) */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_TITLECASE = 0x20, /** * characters should be hidden */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_HIDDEN_TEXT = 0x40, /** * typed text should not be stored */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_SENSITIVE_DATA = 0x80, /** * just latin characters should be entered */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_LATIN = 0x100, /** * the text input is multiline */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_MULTILINE = 0x200, }; #endif /* ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM #define ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM /** * @ingroup iface_zwp_text_input_v2 * content purpose * * The content purpose allows to specify the primary purpose of a text * input. * * This allows an input method to show special purpose input panels with * extra characters or to disallow some characters. */ enum zwp_text_input_v2_content_purpose { /** * default input, allowing all characters */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NORMAL = 0, /** * allow only alphabetic characters */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ALPHA = 1, /** * allow only digits */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DIGITS = 2, /** * input a number (including decimal separator and sign) */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NUMBER = 3, /** * input a phone number */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PHONE = 4, /** * input an URL */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_URL = 5, /** * input an email address */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_EMAIL = 6, /** * input a name of a person */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NAME = 7, /** * input a password (combine with password or sensitive_data hint) */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PASSWORD = 8, /** * input a date */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATE = 9, /** * input a time */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TIME = 10, /** * input a date and time */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATETIME = 11, /** * input for a terminal */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TERMINAL = 12, }; #endif /* ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM #define ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM /** * @ingroup iface_zwp_text_input_v2 * update_state flags * * Defines the reason for sending an updated state. */ enum zwp_text_input_v2_update_state { /** * updated state because it changed */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_CHANGE = 0, /** * full state after enter or input_method_changed event */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_FULL = 1, /** * full state after reset */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_RESET = 2, /** * full state after switching focus to a different widget on client side */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENTER = 3, }; #endif /* ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM #define ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM enum zwp_text_input_v2_input_panel_visibility { /** * the input panel (virtual keyboard) is hidden */ ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_HIDDEN = 0, /** * the input panel (virtual keyboard) is visible */ ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_VISIBLE = 1, }; #endif /* ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM #define ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM enum zwp_text_input_v2_preedit_style { /** * default style for composing text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_DEFAULT = 0, /** * composing text should be shown the same as non-composing text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_NONE = 1, /** * composing text might be bold */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ACTIVE = 2, /** * composing text might be cursive */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INACTIVE = 3, /** * composing text might have a different background color */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_HIGHLIGHT = 4, /** * composing text might be underlined */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_UNDERLINE = 5, /** * composing text should be shown the same as selected text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_SELECTION = 6, /** * composing text might be underlined with a red wavy line */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INCORRECT = 7, }; #endif /* ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM #define ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM enum zwp_text_input_v2_text_direction { /** * automatic text direction based on text and language */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_AUTO = 0, /** * left-to-right */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_LTR = 1, /** * right-to-left */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_RTL = 2, }; #endif /* ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM */ /** * @ingroup iface_zwp_text_input_v2 * @struct zwp_text_input_v2_listener */ struct zwp_text_input_v2_listener { /** * enter event * * Notification that this seat's text-input focus is on a certain * surface. * * When the seat has the keyboard capability the text-input focus * follows the keyboard focus. * @param serial serial to be used by update_state */ void (*enter)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, struct wl_surface *surface); /** * leave event * * Notification that this seat's text-input focus is no longer on * a certain surface. * * The leave notification is sent before the enter notification for * the new focus. * * When the seat has the keyboard capabillity the text-input focus * follows the keyboard focus. */ void (*leave)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, struct wl_surface *surface); /** * state of the input panel * * Notification that the visibility of the input panel (virtual * keyboard) changed. * * The rectangle x, y, width, height defines the area overlapped by * the input panel (virtual keyboard) on the surface having the * text focus in surface local coordinates. * * That can be used to make sure widgets are visible and not * covered by a virtual keyboard. */ void (*input_panel_state)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); /** * pre-edit * * Notify when a new composing text (pre-edit) should be set * around the current cursor position. Any previously set composing * text should be removed. * * The commit text can be used to replace the composing text in * some cases (for example when losing focus). * * The text input should also handle all preedit_style and * preedit_cursor events occurring directly before preedit_string. */ void (*preedit_string)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *text, const char *commit); /** * pre-edit styling * * Sets styling information on composing text. The style is * applied for length bytes from index relative to the beginning of * the composing text (as byte offset). Multiple styles can be * applied to a composing text by sending multiple preedit_styling * events. * * This event is handled as part of a following preedit_string * event. */ void (*preedit_styling)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t index, uint32_t length, uint32_t style); /** * pre-edit cursor * * Sets the cursor position inside the composing text (as byte * offset) relative to the start of the composing text. When index * is a negative number no cursor is shown. * * When no preedit_cursor event is sent the cursor will be at the * end of the composing text by default. * * This event is handled as part of a following preedit_string * event. */ void (*preedit_cursor)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t index); /** * commit * * Notify when text should be inserted into the editor widget. * The text to commit could be either just a single character after * a key press or the result of some composing (pre-edit). It could * be also an empty text when some text should be removed (see * delete_surrounding_text) or when the input cursor should be * moved (see cursor_position). * * Any previously set composing text should be removed. */ void (*commit_string)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *text); /** * set cursor to new position * * Notify when the cursor or anchor position should be modified. * * This event should be handled as part of a following * commit_string event. * * The text between anchor and index should be selected. * @param index position of cursor * @param anchor position of selection anchor */ void (*cursor_position)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t index, int32_t anchor); /** * delete surrounding text * * Notify when the text around the current cursor position should * be deleted. BeforeLength and afterLength is the length (in * bytes) of text before and after the current cursor position * (excluding the selection) to delete. * * This event should be handled as part of a following * commit_string or preedit_string event. * @param before_length length of text before current cursor positon * @param after_length length of text after current cursor positon */ void (*delete_surrounding_text)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t before_length, uint32_t after_length); /** * modifiers map * * Transfer an array of 0-terminated modifiers names. The * position in the array is the index of the modifier as used in * the modifiers bitmask in the keysym event. */ void (*modifiers_map)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_array *map); /** * keysym * * Notify when a key event was sent. Key events should not be * used for normal text input operations, which should be done with * commit_string, delete_surrounding_text, etc. The key event * follows the wl_keyboard key event convention. Sym is a XKB * keysym, state a wl_keyboard key_state. Modifiers are a mask for * effective modifiers (where the modifier indices are set by the * modifiers_map event) */ void (*keysym)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); /** * language * * Sets the language of the input text. The "language" argument * is a RFC-3066 format language tag. */ void (*language)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *language); /** * text direction * * Sets the text direction of input text. * * It is mainly needed for showing input cursor on correct side of * the editor when there is no input yet done and making sure * neutral direction text is laid out properly. */ void (*text_direction)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t direction); /** * configure amount of surrounding text to be sent * * Configure what amount of surrounding text is expected by the * input method. The surrounding text will be sent in the * set_surrounding_text request on the following state information * updates. */ void (*configure_surrounding_text)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t before_cursor, int32_t after_cursor); /** * Notifies about a changed input method * * The input method changed on compositor side, which invalidates * all current state information. New state information should be * sent from the client via state requests (set_surrounding_text, * set_content_hint, ...) and update_state. * @param serial serial to be used by update_state * @param flags currently unused */ void (*input_method_changed)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, uint32_t flags); }; /** * @ingroup iface_zwp_text_input_v2 */ static inline int zwp_text_input_v2_add_listener(struct zwp_text_input_v2 *zwp_text_input_v2, const struct zwp_text_input_v2_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v2, (void (**)(void)) listener, data); } #define ZWP_TEXT_INPUT_V2_DESTROY 0 #define ZWP_TEXT_INPUT_V2_ENABLE 1 #define ZWP_TEXT_INPUT_V2_DISABLE 2 #define ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL 3 #define ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL 4 #define ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT 5 #define ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE 6 #define ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE 7 #define ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE 8 #define ZWP_TEXT_INPUT_V2_UPDATE_STATE 9 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_ENTER_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_INPUT_PANEL_STATE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_STRING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_STYLING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_CURSOR_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_COMMIT_STRING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_CURSOR_POSITION_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_MODIFIERS_MAP_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_KEYSYM_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_LANGUAGE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_CONFIGURE_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_INPUT_METHOD_CHANGED_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_ENABLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DISABLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_UPDATE_STATE_SINCE_VERSION 1 /** @ingroup iface_zwp_text_input_v2 */ static inline void zwp_text_input_v2_set_user_data(struct zwp_text_input_v2 *zwp_text_input_v2, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v2, user_data); } /** @ingroup iface_zwp_text_input_v2 */ static inline void * zwp_text_input_v2_get_user_data(struct zwp_text_input_v2 *zwp_text_input_v2) { return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v2); } static inline uint32_t zwp_text_input_v2_get_version(struct zwp_text_input_v2 *zwp_text_input_v2) { return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v2); } /** * @ingroup iface_zwp_text_input_v2 * * Destroy the wp_text_input object. Also disables all surfaces enabled * through this wp_text_input object */ static inline void zwp_text_input_v2_destroy(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_DESTROY); wl_proxy_destroy((struct wl_proxy *) zwp_text_input_v2); } /** * @ingroup iface_zwp_text_input_v2 * * Enable text input in a surface (usually when a text entry inside of it * has focus). * * This can be called before or after a surface gets text (or keyboard) * focus via the enter event. Text input to a surface is only active * when it has the current text (or keyboard) focus and is enabled. */ static inline void zwp_text_input_v2_enable(struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_surface *surface) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_ENABLE, surface); } /** * @ingroup iface_zwp_text_input_v2 * * Disable text input in a surface (typically when there is no focus on any * text entry inside the surface). */ static inline void zwp_text_input_v2_disable(struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_surface *surface) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_DISABLE, surface); } /** * @ingroup iface_zwp_text_input_v2 * * Requests input panels (virtual keyboard) to show. * * This should be used for example to show a virtual keyboard again * (with a tap) after it was closed by pressing on a close button on the * keyboard. */ static inline void zwp_text_input_v2_show_input_panel(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL); } /** * @ingroup iface_zwp_text_input_v2 * * Requests input panels (virtual keyboard) to hide. */ static inline void zwp_text_input_v2_hide_input_panel(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the plain surrounding text around the input position. Text is * UTF-8 encoded. Cursor is the byte offset within the surrounding text. * Anchor is the byte offset of the selection anchor within the * surrounding text. If there is no selected text, anchor is the same as * cursor. * * Make sure to always send some text before and after the cursor * except when the cursor is at the beginning or end of text. * * When there was a configure_surrounding_text event take the * before_cursor and after_cursor arguments into account for picking how * much surrounding text to send. * * There is a maximum length of wayland messages so text can not be * longer than 4000 bytes. */ static inline void zwp_text_input_v2_set_surrounding_text(struct zwp_text_input_v2 *zwp_text_input_v2, const char *text, int32_t cursor, int32_t anchor) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT, text, cursor, anchor); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the content purpose and content hint. While the purpose is the * basic purpose of an input field, the hint flags allow to modify some * of the behavior. * * When no content type is explicitly set, a normal content purpose with * none hint should be assumed. */ static inline void zwp_text_input_v2_set_content_type(struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t hint, uint32_t purpose) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE, hint, purpose); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the cursor outline as a x, y, width, height rectangle in surface * local coordinates. * * Allows the compositor to put a window with word suggestions near the * cursor. */ static inline void zwp_text_input_v2_set_cursor_rectangle(struct zwp_text_input_v2 *zwp_text_input_v2, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE, x, y, width, height); } /** * @ingroup iface_zwp_text_input_v2 * * Sets a specific language. This allows for example a virtual keyboard to * show a language specific layout. The "language" argument is a RFC-3066 * format language tag. * * It could be used for example in a word processor to indicate language of * currently edited document or in an instant message application which * tracks languages of contacts. */ static inline void zwp_text_input_v2_set_preferred_language(struct zwp_text_input_v2 *zwp_text_input_v2, const char *language) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE, language); } /** * @ingroup iface_zwp_text_input_v2 * * Allows to atomically send state updates from client. * * This request should follow after a batch of state updating requests * like set_surrounding_text, set_content_type, set_cursor_rectangle and * set_preferred_language. * * The flags field indicates why an updated state is sent to the input * method. * * Reset should be used by an editor widget after the text was changed * outside of the normal input method flow. * * For "change" it is enough to send the changed state, else the full * state should be send. * * Serial should be set to the serial from the last enter or * input_method_changed event. * * To make sure to not receive outdated input method events after a * reset or switching to a new widget wl_display_sync() should be used * after update_state in these cases. */ static inline void zwp_text_input_v2_update_state(struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, uint32_t reason) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_UPDATE_STATE, serial, reason); } #define ZWP_TEXT_INPUT_MANAGER_V2_DESTROY 0 #define ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT 1 /** * @ingroup iface_zwp_text_input_manager_v2 */ #define ZWP_TEXT_INPUT_MANAGER_V2_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_manager_v2 */ #define ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT_SINCE_VERSION 1 /** @ingroup iface_zwp_text_input_manager_v2 */ static inline void zwp_text_input_manager_v2_set_user_data(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v2, user_data); } /** @ingroup iface_zwp_text_input_manager_v2 */ static inline void * zwp_text_input_manager_v2_get_user_data(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v2); } static inline uint32_t zwp_text_input_manager_v2_get_version(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v2); } /** * @ingroup iface_zwp_text_input_manager_v2 * * Destroy the wp_text_input_manager object. */ static inline void zwp_text_input_manager_v2_destroy(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_manager_v2, ZWP_TEXT_INPUT_MANAGER_V2_DESTROY); wl_proxy_destroy((struct wl_proxy *) zwp_text_input_manager_v2); } /** * @ingroup iface_zwp_text_input_manager_v2 * * Creates a new text-input object for a given seat. */ static inline struct zwp_text_input_v2 * zwp_text_input_manager_v2_get_text_input(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2, struct wl_seat *seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_text_input_manager_v2, ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT, &zwp_text_input_v2_interface, NULL, seat); return (struct zwp_text_input_v2 *) id; } #ifdef __cplusplus } #endif #endif wayland-touch-extension-client-protocol.h000066400000000000000000000121301476226662200372340ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef TOUCH_EXTENSION_CLIENT_PROTOCOL_H #define TOUCH_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_touch_extension The touch_extension protocol * @section page_ifaces_touch_extension Interfaces * - @subpage page_iface_qt_touch_extension - * @section page_copyright_touch_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_touch_extension; /** * @page page_iface_qt_touch_extension qt_touch_extension * @section page_iface_qt_touch_extension_api API * See @ref iface_qt_touch_extension. */ /** * @defgroup iface_qt_touch_extension The qt_touch_extension interface */ extern const struct wl_interface qt_touch_extension_interface; #ifndef QT_TOUCH_EXTENSION_FLAGS_ENUM #define QT_TOUCH_EXTENSION_FLAGS_ENUM enum qt_touch_extension_flags { QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH = 0x1, }; #endif /* QT_TOUCH_EXTENSION_FLAGS_ENUM */ /** * @ingroup iface_qt_touch_extension * @struct qt_touch_extension_listener */ struct qt_touch_extension_listener { /** */ void (*touch)(void *data, struct qt_touch_extension *qt_touch_extension, uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, struct wl_array *rawdata); /** */ void (*configure)(void *data, struct qt_touch_extension *qt_touch_extension, uint32_t flags); }; /** * @ingroup iface_qt_touch_extension */ static inline int qt_touch_extension_add_listener(struct qt_touch_extension *qt_touch_extension, const struct qt_touch_extension_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_touch_extension, (void (**)(void)) listener, data); } #define QT_TOUCH_EXTENSION_DUMMY 0 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_TOUCH_SINCE_VERSION 1 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_DUMMY_SINCE_VERSION 1 /** @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data); } /** @ingroup iface_qt_touch_extension */ static inline void * qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension) { return wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension); } static inline uint32_t qt_touch_extension_get_version(struct qt_touch_extension *qt_touch_extension) { return wl_proxy_get_version((struct wl_proxy *) qt_touch_extension); } /** @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension) { wl_proxy_destroy((struct wl_proxy *) qt_touch_extension); } /** * @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension) { wl_proxy_marshal((struct wl_proxy *) qt_touch_extension, QT_TOUCH_EXTENSION_DUMMY); } #ifdef __cplusplus } #endif #endif wayland-wayland-client-protocol.h000066400000000000000000004054041476226662200355510ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef WAYLAND_CLIENT_PROTOCOL_H #define WAYLAND_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_wayland The wayland protocol * @section page_ifaces_wayland Interfaces * - @subpage page_iface_wl_display - core global object * - @subpage page_iface_wl_registry - global registry object * - @subpage page_iface_wl_callback - callback object * - @subpage page_iface_wl_compositor - the compositor singleton * - @subpage page_iface_wl_shm_pool - a shared memory pool * - @subpage page_iface_wl_shm - shared memory support * - @subpage page_iface_wl_buffer - content for a wl_surface * - @subpage page_iface_wl_data_offer - offer to transfer data * - @subpage page_iface_wl_data_source - offer to transfer data * - @subpage page_iface_wl_data_device - data transfer device * - @subpage page_iface_wl_data_device_manager - data transfer interface * - @subpage page_iface_wl_shell - create desktop-style surfaces * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface * - @subpage page_iface_wl_surface - an onscreen surface * - @subpage page_iface_wl_seat - group of input devices * - @subpage page_iface_wl_pointer - pointer input device * - @subpage page_iface_wl_keyboard - keyboard input device * - @subpage page_iface_wl_touch - touchscreen input device * - @subpage page_iface_wl_output - compositor output region * - @subpage page_iface_wl_region - region interface * - @subpage page_iface_wl_subcompositor - sub-surface compositing * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface * @section page_copyright_wayland Copyright *
 *
 * Copyright © 2008-2011 Kristian Høgsberg
 * Copyright © 2010-2011 Intel Corporation
 * Copyright © 2012-2013 Collabora, Ltd.
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * 
*/ struct wl_buffer; struct wl_callback; struct wl_compositor; struct wl_data_device; struct wl_data_device_manager; struct wl_data_offer; struct wl_data_source; struct wl_display; struct wl_keyboard; struct wl_output; struct wl_pointer; struct wl_region; struct wl_registry; struct wl_seat; struct wl_shell; struct wl_shell_surface; struct wl_shm; struct wl_shm_pool; struct wl_subcompositor; struct wl_subsurface; struct wl_surface; struct wl_touch; /** * @page page_iface_wl_display wl_display * @section page_iface_wl_display_desc Description * * The core global object. This is a special singleton object. It * is used for internal Wayland protocol features. * @section page_iface_wl_display_api API * See @ref iface_wl_display. */ /** * @defgroup iface_wl_display The wl_display interface * * The core global object. This is a special singleton object. It * is used for internal Wayland protocol features. */ extern const struct wl_interface wl_display_interface; /** * @page page_iface_wl_registry wl_registry * @section page_iface_wl_registry_desc Description * * The global registry object. The server has a number of global * objects that are available to all clients. These objects * typically represent an actual object in the server (for example, * an input device) or they are singleton objects that provide * extension functionality. * * When a client creates a registry object, the registry object * will emit a global event for each global currently in the * registry. Globals come and go as a result of device or * monitor hotplugs, reconfiguration or other events, and the * registry will send out global and global_remove events to * keep the client up to date with the changes. To mark the end * of the initial burst of events, the client can use the * wl_display.sync request immediately after calling * wl_display.get_registry. * * A client can bind to a global object by using the bind * request. This creates a client-side handle that lets the object * emit events to the client and lets the client invoke requests on * the object. * @section page_iface_wl_registry_api API * See @ref iface_wl_registry. */ /** * @defgroup iface_wl_registry The wl_registry interface * * The global registry object. The server has a number of global * objects that are available to all clients. These objects * typically represent an actual object in the server (for example, * an input device) or they are singleton objects that provide * extension functionality. * * When a client creates a registry object, the registry object * will emit a global event for each global currently in the * registry. Globals come and go as a result of device or * monitor hotplugs, reconfiguration or other events, and the * registry will send out global and global_remove events to * keep the client up to date with the changes. To mark the end * of the initial burst of events, the client can use the * wl_display.sync request immediately after calling * wl_display.get_registry. * * A client can bind to a global object by using the bind * request. This creates a client-side handle that lets the object * emit events to the client and lets the client invoke requests on * the object. */ extern const struct wl_interface wl_registry_interface; /** * @page page_iface_wl_callback wl_callback * @section page_iface_wl_callback_desc Description * * Clients can handle the 'done' event to get notified when * the related request is done. * @section page_iface_wl_callback_api API * See @ref iface_wl_callback. */ /** * @defgroup iface_wl_callback The wl_callback interface * * Clients can handle the 'done' event to get notified when * the related request is done. */ extern const struct wl_interface wl_callback_interface; /** * @page page_iface_wl_compositor wl_compositor * @section page_iface_wl_compositor_desc Description * * A compositor. This object is a singleton global. The * compositor is in charge of combining the contents of multiple * surfaces into one displayable output. * @section page_iface_wl_compositor_api API * See @ref iface_wl_compositor. */ /** * @defgroup iface_wl_compositor The wl_compositor interface * * A compositor. This object is a singleton global. The * compositor is in charge of combining the contents of multiple * surfaces into one displayable output. */ extern const struct wl_interface wl_compositor_interface; /** * @page page_iface_wl_shm_pool wl_shm_pool * @section page_iface_wl_shm_pool_desc Description * * The wl_shm_pool object encapsulates a piece of memory shared * between the compositor and client. Through the wl_shm_pool * object, the client can allocate shared memory wl_buffer objects. * All objects created through the same pool share the same * underlying mapped memory. Reusing the mapped memory avoids the * setup/teardown overhead and is useful when interactively resizing * a surface or for many small buffers. * @section page_iface_wl_shm_pool_api API * See @ref iface_wl_shm_pool. */ /** * @defgroup iface_wl_shm_pool The wl_shm_pool interface * * The wl_shm_pool object encapsulates a piece of memory shared * between the compositor and client. Through the wl_shm_pool * object, the client can allocate shared memory wl_buffer objects. * All objects created through the same pool share the same * underlying mapped memory. Reusing the mapped memory avoids the * setup/teardown overhead and is useful when interactively resizing * a surface or for many small buffers. */ extern const struct wl_interface wl_shm_pool_interface; /** * @page page_iface_wl_shm wl_shm * @section page_iface_wl_shm_desc Description * * A global singleton object that provides support for shared * memory. * * Clients can create wl_shm_pool objects using the create_pool * request. * * At connection setup time, the wl_shm object emits one or more * format events to inform clients about the valid pixel formats * that can be used for buffers. * @section page_iface_wl_shm_api API * See @ref iface_wl_shm. */ /** * @defgroup iface_wl_shm The wl_shm interface * * A global singleton object that provides support for shared * memory. * * Clients can create wl_shm_pool objects using the create_pool * request. * * At connection setup time, the wl_shm object emits one or more * format events to inform clients about the valid pixel formats * that can be used for buffers. */ extern const struct wl_interface wl_shm_interface; /** * @page page_iface_wl_buffer wl_buffer * @section page_iface_wl_buffer_desc Description * * A buffer provides the content for a wl_surface. Buffers are * created through factory interfaces such as wl_drm, wl_shm or * similar. It has a width and a height and can be attached to a * wl_surface, but the mechanism by which a client provides and * updates the contents is defined by the buffer factory interface. * @section page_iface_wl_buffer_api API * See @ref iface_wl_buffer. */ /** * @defgroup iface_wl_buffer The wl_buffer interface * * A buffer provides the content for a wl_surface. Buffers are * created through factory interfaces such as wl_drm, wl_shm or * similar. It has a width and a height and can be attached to a * wl_surface, but the mechanism by which a client provides and * updates the contents is defined by the buffer factory interface. */ extern const struct wl_interface wl_buffer_interface; /** * @page page_iface_wl_data_offer wl_data_offer * @section page_iface_wl_data_offer_desc Description * * A wl_data_offer represents a piece of data offered for transfer * by another client (the source client). It is used by the * copy-and-paste and drag-and-drop mechanisms. The offer * describes the different mime types that the data can be * converted to and provides the mechanism for transferring the * data directly from the source client. * @section page_iface_wl_data_offer_api API * See @ref iface_wl_data_offer. */ /** * @defgroup iface_wl_data_offer The wl_data_offer interface * * A wl_data_offer represents a piece of data offered for transfer * by another client (the source client). It is used by the * copy-and-paste and drag-and-drop mechanisms. The offer * describes the different mime types that the data can be * converted to and provides the mechanism for transferring the * data directly from the source client. */ extern const struct wl_interface wl_data_offer_interface; /** * @page page_iface_wl_data_source wl_data_source * @section page_iface_wl_data_source_desc Description * * The wl_data_source object is the source side of a wl_data_offer. * It is created by the source client in a data transfer and * provides a way to describe the offered data and a way to respond * to requests to transfer the data. * @section page_iface_wl_data_source_api API * See @ref iface_wl_data_source. */ /** * @defgroup iface_wl_data_source The wl_data_source interface * * The wl_data_source object is the source side of a wl_data_offer. * It is created by the source client in a data transfer and * provides a way to describe the offered data and a way to respond * to requests to transfer the data. */ extern const struct wl_interface wl_data_source_interface; /** * @page page_iface_wl_data_device wl_data_device * @section page_iface_wl_data_device_desc Description * * There is one wl_data_device per seat which can be obtained * from the global wl_data_device_manager singleton. * * A wl_data_device provides access to inter-client data transfer * mechanisms such as copy-and-paste and drag-and-drop. * @section page_iface_wl_data_device_api API * See @ref iface_wl_data_device. */ /** * @defgroup iface_wl_data_device The wl_data_device interface * * There is one wl_data_device per seat which can be obtained * from the global wl_data_device_manager singleton. * * A wl_data_device provides access to inter-client data transfer * mechanisms such as copy-and-paste and drag-and-drop. */ extern const struct wl_interface wl_data_device_interface; /** * @page page_iface_wl_data_device_manager wl_data_device_manager * @section page_iface_wl_data_device_manager_desc Description * * The wl_data_device_manager is a singleton global object that * provides access to inter-client data transfer mechanisms such as * copy-and-paste and drag-and-drop. These mechanisms are tied to * a wl_seat and this interface lets a client get a wl_data_device * corresponding to a wl_seat. * @section page_iface_wl_data_device_manager_api API * See @ref iface_wl_data_device_manager. */ /** * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface * * The wl_data_device_manager is a singleton global object that * provides access to inter-client data transfer mechanisms such as * copy-and-paste and drag-and-drop. These mechanisms are tied to * a wl_seat and this interface lets a client get a wl_data_device * corresponding to a wl_seat. */ extern const struct wl_interface wl_data_device_manager_interface; /** * @page page_iface_wl_shell wl_shell * @section page_iface_wl_shell_desc Description * * This interface is implemented by servers that provide * desktop-style user interfaces. * * It allows clients to associate a wl_shell_surface with * a basic surface. * @section page_iface_wl_shell_api API * See @ref iface_wl_shell. */ /** * @defgroup iface_wl_shell The wl_shell interface * * This interface is implemented by servers that provide * desktop-style user interfaces. * * It allows clients to associate a wl_shell_surface with * a basic surface. */ extern const struct wl_interface wl_shell_interface; /** * @page page_iface_wl_shell_surface wl_shell_surface * @section page_iface_wl_shell_surface_desc Description * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides requests to treat surfaces like toplevel, fullscreen * or popup windows, move, resize or maximize them, associate * metadata like title and class, etc. * * On the server side the object is automatically destroyed when * the related wl_surface is destroyed. On client side, * wl_shell_surface_destroy() must be called before destroying * the wl_surface object. * @section page_iface_wl_shell_surface_api API * See @ref iface_wl_shell_surface. */ /** * @defgroup iface_wl_shell_surface The wl_shell_surface interface * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides requests to treat surfaces like toplevel, fullscreen * or popup windows, move, resize or maximize them, associate * metadata like title and class, etc. * * On the server side the object is automatically destroyed when * the related wl_surface is destroyed. On client side, * wl_shell_surface_destroy() must be called before destroying * the wl_surface object. */ extern const struct wl_interface wl_shell_surface_interface; /** * @page page_iface_wl_surface wl_surface * @section page_iface_wl_surface_desc Description * * A surface is a rectangular area that is displayed on the screen. * It has a location, size and pixel contents. * * The size of a surface (and relative positions on it) is described * in surface local coordinates, which may differ from the buffer * local coordinates of the pixel content, in case a buffer_transform * or a buffer_scale is used. * * Surfaces are also used for some special purposes, e.g. as * cursor images for pointers, drag icons, etc. * @section page_iface_wl_surface_api API * See @ref iface_wl_surface. */ /** * @defgroup iface_wl_surface The wl_surface interface * * A surface is a rectangular area that is displayed on the screen. * It has a location, size and pixel contents. * * The size of a surface (and relative positions on it) is described * in surface local coordinates, which may differ from the buffer * local coordinates of the pixel content, in case a buffer_transform * or a buffer_scale is used. * * Surfaces are also used for some special purposes, e.g. as * cursor images for pointers, drag icons, etc. */ extern const struct wl_interface wl_surface_interface; /** * @page page_iface_wl_seat wl_seat * @section page_iface_wl_seat_desc Description * * A seat is a group of keyboards, pointer and touch devices. This * object is published as a global during start up, or when such a * device is hot plugged. A seat typically has a pointer and * maintains a keyboard focus and a pointer focus. * @section page_iface_wl_seat_api API * See @ref iface_wl_seat. */ /** * @defgroup iface_wl_seat The wl_seat interface * * A seat is a group of keyboards, pointer and touch devices. This * object is published as a global during start up, or when such a * device is hot plugged. A seat typically has a pointer and * maintains a keyboard focus and a pointer focus. */ extern const struct wl_interface wl_seat_interface; /** * @page page_iface_wl_pointer wl_pointer * @section page_iface_wl_pointer_desc Description * * The wl_pointer interface represents one or more input devices, * such as mice, which control the pointer location and pointer_focus * of a seat. * * The wl_pointer interface generates motion, enter and leave * events for the surfaces that the pointer is located over, * and button and axis events for button presses, button releases * and scrolling. * @section page_iface_wl_pointer_api API * See @ref iface_wl_pointer. */ /** * @defgroup iface_wl_pointer The wl_pointer interface * * The wl_pointer interface represents one or more input devices, * such as mice, which control the pointer location and pointer_focus * of a seat. * * The wl_pointer interface generates motion, enter and leave * events for the surfaces that the pointer is located over, * and button and axis events for button presses, button releases * and scrolling. */ extern const struct wl_interface wl_pointer_interface; /** * @page page_iface_wl_keyboard wl_keyboard * @section page_iface_wl_keyboard_desc Description * * The wl_keyboard interface represents one or more keyboards * associated with a seat. * @section page_iface_wl_keyboard_api API * See @ref iface_wl_keyboard. */ /** * @defgroup iface_wl_keyboard The wl_keyboard interface * * The wl_keyboard interface represents one or more keyboards * associated with a seat. */ extern const struct wl_interface wl_keyboard_interface; /** * @page page_iface_wl_touch wl_touch * @section page_iface_wl_touch_desc Description * * The wl_touch interface represents a touchscreen * associated with a seat. * * Touch interactions can consist of one or more contacts. * For each contact, a series of events is generated, starting * with a down event, followed by zero or more motion events, * and ending with an up event. Events relating to the same * contact point can be identified by the ID of the sequence. * @section page_iface_wl_touch_api API * See @ref iface_wl_touch. */ /** * @defgroup iface_wl_touch The wl_touch interface * * The wl_touch interface represents a touchscreen * associated with a seat. * * Touch interactions can consist of one or more contacts. * For each contact, a series of events is generated, starting * with a down event, followed by zero or more motion events, * and ending with an up event. Events relating to the same * contact point can be identified by the ID of the sequence. */ extern const struct wl_interface wl_touch_interface; /** * @page page_iface_wl_output wl_output * @section page_iface_wl_output_desc Description * * An output describes part of the compositor geometry. The * compositor works in the 'compositor coordinate system' and an * output corresponds to rectangular area in that space that is * actually visible. This typically corresponds to a monitor that * displays part of the compositor space. This object is published * as global during start up, or when a monitor is hotplugged. * @section page_iface_wl_output_api API * See @ref iface_wl_output. */ /** * @defgroup iface_wl_output The wl_output interface * * An output describes part of the compositor geometry. The * compositor works in the 'compositor coordinate system' and an * output corresponds to rectangular area in that space that is * actually visible. This typically corresponds to a monitor that * displays part of the compositor space. This object is published * as global during start up, or when a monitor is hotplugged. */ extern const struct wl_interface wl_output_interface; /** * @page page_iface_wl_region wl_region * @section page_iface_wl_region_desc Description * * A region object describes an area. * * Region objects are used to describe the opaque and input * regions of a surface. * @section page_iface_wl_region_api API * See @ref iface_wl_region. */ /** * @defgroup iface_wl_region The wl_region interface * * A region object describes an area. * * Region objects are used to describe the opaque and input * regions of a surface. */ extern const struct wl_interface wl_region_interface; /** * @page page_iface_wl_subcompositor wl_subcompositor * @section page_iface_wl_subcompositor_desc Description * * The global interface exposing sub-surface compositing capabilities. * A wl_surface, that has sub-surfaces associated, is called the * parent surface. Sub-surfaces can be arbitrarily nested and create * a tree of sub-surfaces. * * The root surface in a tree of sub-surfaces is the main * surface. The main surface cannot be a sub-surface, because * sub-surfaces must always have a parent. * * A main surface with its sub-surfaces forms a (compound) window. * For window management purposes, this set of wl_surface objects is * to be considered as a single window, and it should also behave as * such. * * The aim of sub-surfaces is to offload some of the compositing work * within a window from clients to the compositor. A prime example is * a video player with decorations and video in separate wl_surface * objects. This should allow the compositor to pass YUV video buffer * processing to dedicated overlay hardware when possible. * @section page_iface_wl_subcompositor_api API * See @ref iface_wl_subcompositor. */ /** * @defgroup iface_wl_subcompositor The wl_subcompositor interface * * The global interface exposing sub-surface compositing capabilities. * A wl_surface, that has sub-surfaces associated, is called the * parent surface. Sub-surfaces can be arbitrarily nested and create * a tree of sub-surfaces. * * The root surface in a tree of sub-surfaces is the main * surface. The main surface cannot be a sub-surface, because * sub-surfaces must always have a parent. * * A main surface with its sub-surfaces forms a (compound) window. * For window management purposes, this set of wl_surface objects is * to be considered as a single window, and it should also behave as * such. * * The aim of sub-surfaces is to offload some of the compositing work * within a window from clients to the compositor. A prime example is * a video player with decorations and video in separate wl_surface * objects. This should allow the compositor to pass YUV video buffer * processing to dedicated overlay hardware when possible. */ extern const struct wl_interface wl_subcompositor_interface; /** * @page page_iface_wl_subsurface wl_subsurface * @section page_iface_wl_subsurface_desc Description * * An additional interface to a wl_surface object, which has been * made a sub-surface. A sub-surface has one parent surface. A * sub-surface's size and position are not limited to that of the parent. * Particularly, a sub-surface is not automatically clipped to its * parent's area. * * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied * and the parent surface is mapped. The order of which one happens * first is irrelevant. A sub-surface is hidden if the parent becomes * hidden, or if a NULL wl_buffer is applied. These rules apply * recursively through the tree of surfaces. * * The behaviour of wl_surface.commit request on a sub-surface * depends on the sub-surface's mode. The possible modes are * synchronized and desynchronized, see methods * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized * mode caches the wl_surface state to be applied when the parent's * state gets applied, and desynchronized mode applies the pending * wl_surface state directly. A sub-surface is initially in the * synchronized mode. * * Sub-surfaces have also other kind of state, which is managed by * wl_subsurface requests, as opposed to wl_surface requests. This * state includes the sub-surface position relative to the parent * surface (wl_subsurface.set_position), and the stacking order of * the parent and its sub-surfaces (wl_subsurface.place_above and * .place_below). This state is applied when the parent surface's * wl_surface state is applied, regardless of the sub-surface's mode. * As the exception, set_sync and set_desync are effective immediately. * * The main surface can be thought to be always in desynchronized mode, * since it does not have a parent in the sub-surfaces sense. * * Even if a sub-surface is in desynchronized mode, it will behave as * in synchronized mode, if its parent surface behaves as in * synchronized mode. This rule is applied recursively throughout the * tree of surfaces. This means, that one can set a sub-surface into * synchronized mode, and then assume that all its child and grand-child * sub-surfaces are synchronized, too, without explicitly setting them. * * If the wl_surface associated with the wl_subsurface is destroyed, the * wl_subsurface object becomes inert. Note, that destroying either object * takes effect immediately. If you need to synchronize the removal * of a sub-surface to the parent surface update, unmap the sub-surface * first by attaching a NULL wl_buffer, update parent, and then destroy * the sub-surface. * * If the parent wl_surface object is destroyed, the sub-surface is * unmapped. * @section page_iface_wl_subsurface_api API * See @ref iface_wl_subsurface. */ /** * @defgroup iface_wl_subsurface The wl_subsurface interface * * An additional interface to a wl_surface object, which has been * made a sub-surface. A sub-surface has one parent surface. A * sub-surface's size and position are not limited to that of the parent. * Particularly, a sub-surface is not automatically clipped to its * parent's area. * * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied * and the parent surface is mapped. The order of which one happens * first is irrelevant. A sub-surface is hidden if the parent becomes * hidden, or if a NULL wl_buffer is applied. These rules apply * recursively through the tree of surfaces. * * The behaviour of wl_surface.commit request on a sub-surface * depends on the sub-surface's mode. The possible modes are * synchronized and desynchronized, see methods * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized * mode caches the wl_surface state to be applied when the parent's * state gets applied, and desynchronized mode applies the pending * wl_surface state directly. A sub-surface is initially in the * synchronized mode. * * Sub-surfaces have also other kind of state, which is managed by * wl_subsurface requests, as opposed to wl_surface requests. This * state includes the sub-surface position relative to the parent * surface (wl_subsurface.set_position), and the stacking order of * the parent and its sub-surfaces (wl_subsurface.place_above and * .place_below). This state is applied when the parent surface's * wl_surface state is applied, regardless of the sub-surface's mode. * As the exception, set_sync and set_desync are effective immediately. * * The main surface can be thought to be always in desynchronized mode, * since it does not have a parent in the sub-surfaces sense. * * Even if a sub-surface is in desynchronized mode, it will behave as * in synchronized mode, if its parent surface behaves as in * synchronized mode. This rule is applied recursively throughout the * tree of surfaces. This means, that one can set a sub-surface into * synchronized mode, and then assume that all its child and grand-child * sub-surfaces are synchronized, too, without explicitly setting them. * * If the wl_surface associated with the wl_subsurface is destroyed, the * wl_subsurface object becomes inert. Note, that destroying either object * takes effect immediately. If you need to synchronize the removal * of a sub-surface to the parent surface update, unmap the sub-surface * first by attaching a NULL wl_buffer, update parent, and then destroy * the sub-surface. * * If the parent wl_surface object is destroyed, the sub-surface is * unmapped. */ extern const struct wl_interface wl_subsurface_interface; #ifndef WL_DISPLAY_ERROR_ENUM #define WL_DISPLAY_ERROR_ENUM /** * @ingroup iface_wl_display * global error values * * These errors are global and can be emitted in response to any * server request. */ enum wl_display_error { /** * server couldn't find object */ WL_DISPLAY_ERROR_INVALID_OBJECT = 0, /** * method doesn't exist on the specified interface */ WL_DISPLAY_ERROR_INVALID_METHOD = 1, /** * server is out of memory */ WL_DISPLAY_ERROR_NO_MEMORY = 2, }; #endif /* WL_DISPLAY_ERROR_ENUM */ /** * @ingroup iface_wl_display * @struct wl_display_listener */ struct wl_display_listener { /** * fatal error event * * The error event is sent out when a fatal (non-recoverable) * error has occurred. The object_id argument is the object where * the error occurred, most often in response to a request to that * object. The code identifies the error and is defined by the * object interface. As such, each interface defines its own set of * error codes. The message is an brief description of the error, * for (debugging) convenience. */ void (*error)(void *data, struct wl_display *wl_display, void *object_id, uint32_t code, const char *message); /** * acknowledge object ID deletion * * This event is used internally by the object ID management * logic. When a client deletes an object, the server will send * this event to acknowledge that it has seen the delete request. * When the client receive this event, it will know that it can * safely reuse the object ID. */ void (*delete_id)(void *data, struct wl_display *wl_display, uint32_t id); }; /** * @ingroup iface_wl_display */ static inline int wl_display_add_listener(struct wl_display *wl_display, const struct wl_display_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_display, (void (**)(void)) listener, data); } #define WL_DISPLAY_SYNC 0 #define WL_DISPLAY_GET_REGISTRY 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_ERROR_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_SYNC_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1 /** @ingroup iface_wl_display */ static inline void wl_display_set_user_data(struct wl_display *wl_display, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data); } /** @ingroup iface_wl_display */ static inline void * wl_display_get_user_data(struct wl_display *wl_display) { return wl_proxy_get_user_data((struct wl_proxy *) wl_display); } static inline uint32_t wl_display_get_version(struct wl_display *wl_display) { return wl_proxy_get_version((struct wl_proxy *) wl_display); } /** * @ingroup iface_wl_display * * The sync request asks the server to emit the 'done' event * on the returned wl_callback object. Since requests are * handled in-order and events are delivered in-order, this can * be used as a barrier to ensure all previous requests and the * resulting events have been handled. * * The object returned by this request will be destroyed by the * compositor after the callback is fired and as such the client must not * attempt to use it after that point. * * The callback_data passed in the callback is the event serial. */ static inline struct wl_callback * wl_display_sync(struct wl_display *wl_display) { struct wl_proxy *callback; callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display, WL_DISPLAY_SYNC, &wl_callback_interface, NULL); return (struct wl_callback *) callback; } /** * @ingroup iface_wl_display * * This request creates a registry object that allows the client * to list and bind the global objects available from the * compositor. */ static inline struct wl_registry * wl_display_get_registry(struct wl_display *wl_display) { struct wl_proxy *registry; registry = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display, WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL); return (struct wl_registry *) registry; } /** * @ingroup iface_wl_registry * @struct wl_registry_listener */ struct wl_registry_listener { /** * announce global object * * Notify the client of global objects. * * The event notifies the client that a global object with the * given name is now available, and it implements the given version * of the given interface. */ void (*global)(void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version); /** * announce removal of global object * * Notify the client of removed global objects. * * This event notifies the client that the global identified by * name is no longer available. If the client bound to the global * using the bind request, the client should now destroy that * object. * * The object remains valid and requests to the object will be * ignored until the client destroys it, to avoid races between the * global going away and a client sending a request to it. */ void (*global_remove)(void *data, struct wl_registry *wl_registry, uint32_t name); }; /** * @ingroup iface_wl_registry */ static inline int wl_registry_add_listener(struct wl_registry *wl_registry, const struct wl_registry_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_registry, (void (**)(void)) listener, data); } #define WL_REGISTRY_BIND 0 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_GLOBAL_SINCE_VERSION 1 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_BIND_SINCE_VERSION 1 /** @ingroup iface_wl_registry */ static inline void wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data); } /** @ingroup iface_wl_registry */ static inline void * wl_registry_get_user_data(struct wl_registry *wl_registry) { return wl_proxy_get_user_data((struct wl_proxy *) wl_registry); } static inline uint32_t wl_registry_get_version(struct wl_registry *wl_registry) { return wl_proxy_get_version((struct wl_proxy *) wl_registry); } /** @ingroup iface_wl_registry */ static inline void wl_registry_destroy(struct wl_registry *wl_registry) { wl_proxy_destroy((struct wl_proxy *) wl_registry); } /** * @ingroup iface_wl_registry * * Binds a new, client-created object to the server using the * specified name as the identifier. */ static inline void * wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version) { struct wl_proxy *id; id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry, WL_REGISTRY_BIND, interface, version, name, interface->name, version, NULL); return (void *) id; } /** * @ingroup iface_wl_callback * @struct wl_callback_listener */ struct wl_callback_listener { /** * done event * * Notify the client when the related request is done. * @param callback_data request-specific data for the wl_callback */ void (*done)(void *data, struct wl_callback *wl_callback, uint32_t callback_data); }; /** * @ingroup iface_wl_callback */ static inline int wl_callback_add_listener(struct wl_callback *wl_callback, const struct wl_callback_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_callback, (void (**)(void)) listener, data); } /** * @ingroup iface_wl_callback */ #define WL_CALLBACK_DONE_SINCE_VERSION 1 /** @ingroup iface_wl_callback */ static inline void wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data); } /** @ingroup iface_wl_callback */ static inline void * wl_callback_get_user_data(struct wl_callback *wl_callback) { return wl_proxy_get_user_data((struct wl_proxy *) wl_callback); } static inline uint32_t wl_callback_get_version(struct wl_callback *wl_callback) { return wl_proxy_get_version((struct wl_proxy *) wl_callback); } /** @ingroup iface_wl_callback */ static inline void wl_callback_destroy(struct wl_callback *wl_callback) { wl_proxy_destroy((struct wl_proxy *) wl_callback); } #define WL_COMPOSITOR_CREATE_SURFACE 0 #define WL_COMPOSITOR_CREATE_REGION 1 /** * @ingroup iface_wl_compositor */ #define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1 /** * @ingroup iface_wl_compositor */ #define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1 /** @ingroup iface_wl_compositor */ static inline void wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data); } /** @ingroup iface_wl_compositor */ static inline void * wl_compositor_get_user_data(struct wl_compositor *wl_compositor) { return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor); } static inline uint32_t wl_compositor_get_version(struct wl_compositor *wl_compositor) { return wl_proxy_get_version((struct wl_proxy *) wl_compositor); } /** @ingroup iface_wl_compositor */ static inline void wl_compositor_destroy(struct wl_compositor *wl_compositor) { wl_proxy_destroy((struct wl_proxy *) wl_compositor); } /** * @ingroup iface_wl_compositor * * Ask the compositor to create a new surface. */ static inline struct wl_surface * wl_compositor_create_surface(struct wl_compositor *wl_compositor) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor, WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, NULL); return (struct wl_surface *) id; } /** * @ingroup iface_wl_compositor * * Ask the compositor to create a new region. */ static inline struct wl_region * wl_compositor_create_region(struct wl_compositor *wl_compositor) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor, WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL); return (struct wl_region *) id; } #define WL_SHM_POOL_CREATE_BUFFER 0 #define WL_SHM_POOL_DESTROY 1 #define WL_SHM_POOL_RESIZE 2 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_RESIZE_SINCE_VERSION 1 /** @ingroup iface_wl_shm_pool */ static inline void wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data); } /** @ingroup iface_wl_shm_pool */ static inline void * wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool); } static inline uint32_t wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool) { return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool); } /** * @ingroup iface_wl_shm_pool * * Create a wl_buffer object from the pool. * * The buffer is created offset bytes into the pool and has * width and height as specified. The stride arguments specifies * the number of bytes from beginning of one row to the beginning * of the next. The format is the pixel format of the buffer and * must be one of those advertised through the wl_shm.format event. * * A buffer will keep a reference to the pool it was created from * so it is valid to destroy the pool immediately after creating * a buffer from it. */ static inline struct wl_buffer * wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format); return (struct wl_buffer *) id; } /** * @ingroup iface_wl_shm_pool * * Destroy the shared memory pool. * * The mmapped memory will be released when all * buffers that have been created from this pool * are gone. */ static inline void wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool) { wl_proxy_marshal((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_shm_pool); } /** * @ingroup iface_wl_shm_pool * * This request will cause the server to remap the backing memory * for the pool from the file descriptor passed when the pool was * created, but using the new size. This request can only be * used to make the pool bigger. */ static inline void wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size) { wl_proxy_marshal((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_RESIZE, size); } #ifndef WL_SHM_ERROR_ENUM #define WL_SHM_ERROR_ENUM /** * @ingroup iface_wl_shm * wl_shm error values * * These errors can be emitted in response to wl_shm requests. */ enum wl_shm_error { /** * buffer format is not known */ WL_SHM_ERROR_INVALID_FORMAT = 0, /** * invalid size or stride during pool or buffer creation */ WL_SHM_ERROR_INVALID_STRIDE = 1, /** * mmapping the file descriptor failed */ WL_SHM_ERROR_INVALID_FD = 2, }; #endif /* WL_SHM_ERROR_ENUM */ #ifndef WL_SHM_FORMAT_ENUM #define WL_SHM_FORMAT_ENUM /** * @ingroup iface_wl_shm * pixel formats * * This describes the memory layout of an individual pixel. * * All renderers should support argb8888 and xrgb8888 but any other * formats are optional and may not be supported by the particular * renderer in use. */ enum wl_shm_format { /** * 32-bit ARGB format */ WL_SHM_FORMAT_ARGB8888 = 0, /** * 32-bit RGB format */ WL_SHM_FORMAT_XRGB8888 = 1, WL_SHM_FORMAT_C8 = 0x20203843, WL_SHM_FORMAT_RGB332 = 0x38424752, WL_SHM_FORMAT_BGR233 = 0x38524742, WL_SHM_FORMAT_XRGB4444 = 0x32315258, WL_SHM_FORMAT_XBGR4444 = 0x32314258, WL_SHM_FORMAT_RGBX4444 = 0x32315852, WL_SHM_FORMAT_BGRX4444 = 0x32315842, WL_SHM_FORMAT_ARGB4444 = 0x32315241, WL_SHM_FORMAT_ABGR4444 = 0x32314241, WL_SHM_FORMAT_RGBA4444 = 0x32314152, WL_SHM_FORMAT_BGRA4444 = 0x32314142, WL_SHM_FORMAT_XRGB1555 = 0x35315258, WL_SHM_FORMAT_XBGR1555 = 0x35314258, WL_SHM_FORMAT_RGBX5551 = 0x35315852, WL_SHM_FORMAT_BGRX5551 = 0x35315842, WL_SHM_FORMAT_ARGB1555 = 0x35315241, WL_SHM_FORMAT_ABGR1555 = 0x35314241, WL_SHM_FORMAT_RGBA5551 = 0x35314152, WL_SHM_FORMAT_BGRA5551 = 0x35314142, WL_SHM_FORMAT_RGB565 = 0x36314752, WL_SHM_FORMAT_BGR565 = 0x36314742, WL_SHM_FORMAT_RGB888 = 0x34324752, WL_SHM_FORMAT_BGR888 = 0x34324742, WL_SHM_FORMAT_XBGR8888 = 0x34324258, WL_SHM_FORMAT_RGBX8888 = 0x34325852, WL_SHM_FORMAT_BGRX8888 = 0x34325842, WL_SHM_FORMAT_ABGR8888 = 0x34324241, WL_SHM_FORMAT_RGBA8888 = 0x34324152, WL_SHM_FORMAT_BGRA8888 = 0x34324142, WL_SHM_FORMAT_XRGB2101010 = 0x30335258, WL_SHM_FORMAT_XBGR2101010 = 0x30334258, WL_SHM_FORMAT_RGBX1010102 = 0x30335852, WL_SHM_FORMAT_BGRX1010102 = 0x30335842, WL_SHM_FORMAT_ARGB2101010 = 0x30335241, WL_SHM_FORMAT_ABGR2101010 = 0x30334241, WL_SHM_FORMAT_RGBA1010102 = 0x30334152, WL_SHM_FORMAT_BGRA1010102 = 0x30334142, WL_SHM_FORMAT_YUYV = 0x56595559, WL_SHM_FORMAT_YVYU = 0x55595659, WL_SHM_FORMAT_UYVY = 0x59565955, WL_SHM_FORMAT_VYUY = 0x59555956, WL_SHM_FORMAT_AYUV = 0x56555941, WL_SHM_FORMAT_NV12 = 0x3231564e, WL_SHM_FORMAT_NV21 = 0x3132564e, WL_SHM_FORMAT_NV16 = 0x3631564e, WL_SHM_FORMAT_NV61 = 0x3136564e, WL_SHM_FORMAT_YUV410 = 0x39565559, WL_SHM_FORMAT_YVU410 = 0x39555659, WL_SHM_FORMAT_YUV411 = 0x31315559, WL_SHM_FORMAT_YVU411 = 0x31315659, WL_SHM_FORMAT_YUV420 = 0x32315559, WL_SHM_FORMAT_YVU420 = 0x32315659, WL_SHM_FORMAT_YUV422 = 0x36315559, WL_SHM_FORMAT_YVU422 = 0x36315659, WL_SHM_FORMAT_YUV444 = 0x34325559, WL_SHM_FORMAT_YVU444 = 0x34325659, }; #endif /* WL_SHM_FORMAT_ENUM */ /** * @ingroup iface_wl_shm * @struct wl_shm_listener */ struct wl_shm_listener { /** * pixel format description * * Informs the client about a valid pixel format that can be used * for buffers. Known formats include argb8888 and xrgb8888. */ void (*format)(void *data, struct wl_shm *wl_shm, uint32_t format); }; /** * @ingroup iface_wl_shm */ static inline int wl_shm_add_listener(struct wl_shm *wl_shm, const struct wl_shm_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_shm, (void (**)(void)) listener, data); } #define WL_SHM_CREATE_POOL 0 /** * @ingroup iface_wl_shm */ #define WL_SHM_FORMAT_SINCE_VERSION 1 /** * @ingroup iface_wl_shm */ #define WL_SHM_CREATE_POOL_SINCE_VERSION 1 /** @ingroup iface_wl_shm */ static inline void wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data); } /** @ingroup iface_wl_shm */ static inline void * wl_shm_get_user_data(struct wl_shm *wl_shm) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shm); } static inline uint32_t wl_shm_get_version(struct wl_shm *wl_shm) { return wl_proxy_get_version((struct wl_proxy *) wl_shm); } /** @ingroup iface_wl_shm */ static inline void wl_shm_destroy(struct wl_shm *wl_shm) { wl_proxy_destroy((struct wl_proxy *) wl_shm); } /** * @ingroup iface_wl_shm * * Create a new wl_shm_pool object. * * The pool can be used to create shared memory based buffer * objects. The server will mmap size bytes of the passed file * descriptor, to use as backing memory for the pool. */ static inline struct wl_shm_pool * wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm, WL_SHM_CREATE_POOL, &wl_shm_pool_interface, NULL, fd, size); return (struct wl_shm_pool *) id; } /** * @ingroup iface_wl_buffer * @struct wl_buffer_listener */ struct wl_buffer_listener { /** * compositor releases buffer * * Sent when this wl_buffer is no longer used by the compositor. * The client is now free to re-use or destroy this buffer and its * backing storage. * * If a client receives a release event before the frame callback * requested in the same wl_surface.commit that attaches this * wl_buffer to a surface, then the client is immediately free to * re-use the buffer and its backing storage, and does not need a * second buffer for the next surface content update. Typically * this is possible, when the compositor maintains a copy of the * wl_surface contents, e.g. as a GL texture. This is an important * optimization for GL(ES) compositors with wl_shm clients. */ void (*release)(void *data, struct wl_buffer *wl_buffer); }; /** * @ingroup iface_wl_buffer */ static inline int wl_buffer_add_listener(struct wl_buffer *wl_buffer, const struct wl_buffer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_buffer, (void (**)(void)) listener, data); } #define WL_BUFFER_DESTROY 0 /** * @ingroup iface_wl_buffer */ #define WL_BUFFER_RELEASE_SINCE_VERSION 1 /** * @ingroup iface_wl_buffer */ #define WL_BUFFER_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_buffer */ static inline void wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data); } /** @ingroup iface_wl_buffer */ static inline void * wl_buffer_get_user_data(struct wl_buffer *wl_buffer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer); } static inline uint32_t wl_buffer_get_version(struct wl_buffer *wl_buffer) { return wl_proxy_get_version((struct wl_proxy *) wl_buffer); } /** * @ingroup iface_wl_buffer * * Destroy a buffer. If and how you need to release the backing * storage is defined by the buffer factory interface. * * For possible side-effects to a surface, see wl_surface.attach. */ static inline void wl_buffer_destroy(struct wl_buffer *wl_buffer) { wl_proxy_marshal((struct wl_proxy *) wl_buffer, WL_BUFFER_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_buffer); } /** * @ingroup iface_wl_data_offer * @struct wl_data_offer_listener */ struct wl_data_offer_listener { /** * advertise offered mime type * * Sent immediately after creating the wl_data_offer object. One * event per offered mime type. */ void (*offer)(void *data, struct wl_data_offer *wl_data_offer, const char *mime_type); }; /** * @ingroup iface_wl_data_offer */ static inline int wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer, const struct wl_data_offer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer, (void (**)(void)) listener, data); } #define WL_DATA_OFFER_ACCEPT 0 #define WL_DATA_OFFER_RECEIVE 1 #define WL_DATA_OFFER_DESTROY 2 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_data_offer */ static inline void wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data); } /** @ingroup iface_wl_data_offer */ static inline void * wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer); } static inline uint32_t wl_data_offer_get_version(struct wl_data_offer *wl_data_offer) { return wl_proxy_get_version((struct wl_proxy *) wl_data_offer); } /** * @ingroup iface_wl_data_offer * * Indicate that the client can accept the given mime type, or * NULL for not accepted. * * Used for feedback during drag-and-drop. */ static inline void wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_ACCEPT, serial, mime_type); } /** * @ingroup iface_wl_data_offer * * To transfer the offered data, the client issues this request * and indicates the mime type it wants to receive. The transfer * happens through the passed file descriptor (typically created * with the pipe system call). The source client writes the data * in the mime type representation requested and then closes the * file descriptor. * * The receiving client reads from the read end of the pipe until * EOF and the closes its end, at which point the transfer is * complete. */ static inline void wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_RECEIVE, mime_type, fd); } /** * @ingroup iface_wl_data_offer * * Destroy the data offer. */ static inline void wl_data_offer_destroy(struct wl_data_offer *wl_data_offer) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_data_offer); } /** * @ingroup iface_wl_data_source * @struct wl_data_source_listener */ struct wl_data_source_listener { /** * a target accepts an offered mime type * * Sent when a target accepts pointer_focus or motion events. If * a target does not accept any of the offered types, type is NULL. * * Used for feedback during drag-and-drop. */ void (*target)(void *data, struct wl_data_source *wl_data_source, const char *mime_type); /** * send the data * * Request for data from the client. Send the data as the * specified mime type over the passed file descriptor, then close * it. */ void (*send)(void *data, struct wl_data_source *wl_data_source, const char *mime_type, int32_t fd); /** * selection was cancelled * * This data source has been replaced by another data source. The * client should clean up and destroy this data source. */ void (*cancelled)(void *data, struct wl_data_source *wl_data_source); }; /** * @ingroup iface_wl_data_source */ static inline int wl_data_source_add_listener(struct wl_data_source *wl_data_source, const struct wl_data_source_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_source, (void (**)(void)) listener, data); } #define WL_DATA_SOURCE_OFFER 0 #define WL_DATA_SOURCE_DESTROY 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_data_source */ static inline void wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data); } /** @ingroup iface_wl_data_source */ static inline void * wl_data_source_get_user_data(struct wl_data_source *wl_data_source) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source); } static inline uint32_t wl_data_source_get_version(struct wl_data_source *wl_data_source) { return wl_proxy_get_version((struct wl_proxy *) wl_data_source); } /** * @ingroup iface_wl_data_source * * This request adds a mime type to the set of mime types * advertised to targets. Can be called several times to offer * multiple types. */ static inline void wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type) { wl_proxy_marshal((struct wl_proxy *) wl_data_source, WL_DATA_SOURCE_OFFER, mime_type); } /** * @ingroup iface_wl_data_source * * Destroy the data source. */ static inline void wl_data_source_destroy(struct wl_data_source *wl_data_source) { wl_proxy_marshal((struct wl_proxy *) wl_data_source, WL_DATA_SOURCE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_data_source); } /** * @ingroup iface_wl_data_device * @struct wl_data_device_listener */ struct wl_data_device_listener { /** * introduce a new wl_data_offer * * The data_offer event introduces a new wl_data_offer object, * which will subsequently be used in either the data_device.enter * event (for drag-and-drop) or the data_device.selection event * (for selections). Immediately following the * data_device_data_offer event, the new data_offer object will * send out data_offer.offer events to describe the mime types it * offers. */ void (*data_offer)(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id); /** * initiate drag-and-drop session * * This event is sent when an active drag-and-drop pointer enters * a surface owned by the client. The position of the pointer at * enter time is provided by the x and y arguments, in surface * local coordinates. */ void (*enter)(void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id); /** * end drag-and-drop session * * This event is sent when the drag-and-drop pointer leaves the * surface and the session ends. The client must destroy the * wl_data_offer introduced at enter time at this point. */ void (*leave)(void *data, struct wl_data_device *wl_data_device); /** * drag-and-drop session motion * * This event is sent when the drag-and-drop pointer moves within * the currently focused surface. The new position of the pointer * is provided by the x and y arguments, in surface local * coordinates. * @param time timestamp with millisecond granularity */ void (*motion)(void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y); /** * end drag-and-drag session successfully * * The event is sent when a drag-and-drop operation is ended * because the implicit grab is removed. */ void (*drop)(void *data, struct wl_data_device *wl_data_device); /** * advertise new selection * * The selection event is sent out to notify the client of a new * wl_data_offer for the selection for this device. The * data_device.data_offer and the data_offer.offer events are sent * out immediately before this event to introduce the data offer * object. The selection event is sent to a client immediately * before receiving keyboard focus and when a new selection is set * while the client has keyboard focus. The data_offer is valid * until a new data_offer or NULL is received or until the client * loses keyboard focus. */ void (*selection)(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id); }; /** * @ingroup iface_wl_data_device */ static inline int wl_data_device_add_listener(struct wl_data_device *wl_data_device, const struct wl_data_device_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_device, (void (**)(void)) listener, data); } #define WL_DATA_DEVICE_START_DRAG 0 #define WL_DATA_DEVICE_SET_SELECTION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_DROP_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1 /** @ingroup iface_wl_data_device */ static inline void wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data); } /** @ingroup iface_wl_data_device */ static inline void * wl_data_device_get_user_data(struct wl_data_device *wl_data_device) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device); } static inline uint32_t wl_data_device_get_version(struct wl_data_device *wl_data_device) { return wl_proxy_get_version((struct wl_proxy *) wl_data_device); } /** @ingroup iface_wl_data_device */ static inline void wl_data_device_destroy(struct wl_data_device *wl_data_device) { wl_proxy_destroy((struct wl_proxy *) wl_data_device); } /** * @ingroup iface_wl_data_device * * This request asks the compositor to start a drag-and-drop * operation on behalf of the client. * * The source argument is the data source that provides the data * for the eventual data transfer. If source is NULL, enter, leave * and motion events are sent only to the client that initiated the * drag and the client is expected to handle the data passing * internally. * * The origin surface is the surface where the drag originates and * the client must have an active implicit grab that matches the * serial. * * The icon surface is an optional (can be NULL) surface that * provides an icon to be moved around with the cursor. Initially, * the top-left corner of the icon surface is placed at the cursor * hotspot, but subsequent wl_surface.attach request can move the * relative position. Attach requests must be confirmed with * wl_surface.commit as usual. * * The current and pending input regions of the icon wl_surface are * cleared, and wl_surface.set_input_region is ignored until the * wl_surface is no longer used as the icon surface. When the use * as an icon ends, the current and pending input regions become * undefined, and the wl_surface is unmapped. */ static inline void wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_data_device, WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial); } /** * @ingroup iface_wl_data_device * * This request asks the compositor to set the selection * to the data from the source on behalf of the client. * * To unset the selection, set the source to NULL. */ static inline void wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_data_device, WL_DATA_DEVICE_SET_SELECTION, source, serial); } #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0 #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1 /** * @ingroup iface_wl_data_device_manager */ #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device_manager */ #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1 /** @ingroup iface_wl_data_device_manager */ static inline void wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data); } /** @ingroup iface_wl_data_device_manager */ static inline void * wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager); } static inline uint32_t wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager) { return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager); } /** @ingroup iface_wl_data_device_manager */ static inline void wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager) { wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager); } /** * @ingroup iface_wl_data_device_manager * * Create a new data source. */ static inline struct wl_data_source * wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager, WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, NULL); return (struct wl_data_source *) id; } /** * @ingroup iface_wl_data_device_manager * * Create a new data device for a given seat. */ static inline struct wl_data_device * wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager, WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, NULL, seat); return (struct wl_data_device *) id; } #define WL_SHELL_GET_SHELL_SURFACE 0 /** * @ingroup iface_wl_shell */ #define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1 /** @ingroup iface_wl_shell */ static inline void wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data); } /** @ingroup iface_wl_shell */ static inline void * wl_shell_get_user_data(struct wl_shell *wl_shell) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shell); } static inline uint32_t wl_shell_get_version(struct wl_shell *wl_shell) { return wl_proxy_get_version((struct wl_proxy *) wl_shell); } /** @ingroup iface_wl_shell */ static inline void wl_shell_destroy(struct wl_shell *wl_shell) { wl_proxy_destroy((struct wl_proxy *) wl_shell); } /** * @ingroup iface_wl_shell * * Create a shell surface for an existing surface. * * Only one shell surface can be associated with a given surface. */ static inline struct wl_shell_surface * wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shell, WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, NULL, surface); return (struct wl_shell_surface *) id; } #ifndef WL_SHELL_SURFACE_RESIZE_ENUM #define WL_SHELL_SURFACE_RESIZE_ENUM /** * @ingroup iface_wl_shell_surface * edge values for resizing * * These values are used to indicate which edge of a surface * is being dragged in a resize operation. The server may * use this information to adapt its behavior, e.g. choose * an appropriate cursor image. */ enum wl_shell_surface_resize { WL_SHELL_SURFACE_RESIZE_NONE = 0, WL_SHELL_SURFACE_RESIZE_TOP = 1, WL_SHELL_SURFACE_RESIZE_BOTTOM = 2, WL_SHELL_SURFACE_RESIZE_LEFT = 4, WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5, WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6, WL_SHELL_SURFACE_RESIZE_RIGHT = 8, WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10, }; #endif /* WL_SHELL_SURFACE_RESIZE_ENUM */ #ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM #define WL_SHELL_SURFACE_TRANSIENT_ENUM /** * @ingroup iface_wl_shell_surface * details of transient behaviour * * These flags specify details of the expected behaviour * of transient surfaces. Used in the set_transient request. */ enum wl_shell_surface_transient { /** * do not set keyboard focus */ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1, }; #endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */ #ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM #define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM /** * @ingroup iface_wl_shell_surface * different method to set the surface fullscreen * * Hints to indicate to the compositor how to deal with a conflict * between the dimensions of the surface and the dimensions of the * output. The compositor is free to ignore this parameter. */ enum wl_shell_surface_fullscreen_method { /** * no preference, apply default policy */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0, /** * scale, preserve the surface's aspect ratio and center on output */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1, /** * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2, /** * no upscaling, center on output and add black borders to compensate size mismatch */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3, }; #endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */ /** * @ingroup iface_wl_shell_surface * @struct wl_shell_surface_listener */ struct wl_shell_surface_listener { /** * ping client * * Ping a client to check if it is receiving events and sending * requests. A client is expected to reply with a pong request. */ void (*ping)(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial); /** * suggest resize * * The configure event asks the client to resize its surface. * * The size is a hint, in the sense that the client is free to * ignore it if it doesn't resize, pick a smaller size (to satisfy * aspect ratio or resize in steps of NxM pixels). * * The edges parameter provides a hint about how the surface was * resized. The client may use this information to decide how to * adjust its content to the new size (e.g. a scrolling area might * adjust its content position to leave the viewable content * unmoved). * * The client is free to dismiss all but the last configure event * it received. * * The width and height arguments specify the size of the window in * surface local coordinates. */ void (*configure)(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t edges, int32_t width, int32_t height); /** * popup interaction is done * * The popup_done event is sent out when a popup grab is broken, * that is, when the user clicks a surface that doesn't belong to * the client owning the popup surface. */ void (*popup_done)(void *data, struct wl_shell_surface *wl_shell_surface); }; /** * @ingroup iface_wl_shell_surface */ static inline int wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface, const struct wl_shell_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface, (void (**)(void)) listener, data); } #define WL_SHELL_SURFACE_PONG 0 #define WL_SHELL_SURFACE_MOVE 1 #define WL_SHELL_SURFACE_RESIZE 2 #define WL_SHELL_SURFACE_SET_TOPLEVEL 3 #define WL_SHELL_SURFACE_SET_TRANSIENT 4 #define WL_SHELL_SURFACE_SET_FULLSCREEN 5 #define WL_SHELL_SURFACE_SET_POPUP 6 #define WL_SHELL_SURFACE_SET_MAXIMIZED 7 #define WL_SHELL_SURFACE_SET_TITLE 8 #define WL_SHELL_SURFACE_SET_CLASS 9 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_PING_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1 /** @ingroup iface_wl_shell_surface */ static inline void wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data); } /** @ingroup iface_wl_shell_surface */ static inline void * wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface); } static inline uint32_t wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface) { return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface); } /** @ingroup iface_wl_shell_surface */ static inline void wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface) { wl_proxy_destroy((struct wl_proxy *) wl_shell_surface); } /** * @ingroup iface_wl_shell_surface * * A client must respond to a ping event with a pong request or * the client may be deemed unresponsive. */ static inline void wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_PONG, serial); } /** * @ingroup iface_wl_shell_surface * * Start a pointer-driven move of the surface. * * This request must be used in response to a button press event. * The server may ignore move requests depending on the state of * the surface (e.g. fullscreen or maximized). */ static inline void wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_MOVE, seat, serial); } /** * @ingroup iface_wl_shell_surface * * Start a pointer-driven resizing of the surface. * * This request must be used in response to a button press event. * The server may ignore resize requests depending on the state of * the surface (e.g. fullscreen or maximized). */ static inline void wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_RESIZE, seat, serial, edges); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a toplevel surface. * * A toplevel surface is not fullscreen, maximized or transient. */ static inline void wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TOPLEVEL); } /** * @ingroup iface_wl_shell_surface * * Map the surface relative to an existing surface. * * The x and y arguments specify the locations of the upper left * corner of the surface relative to the upper left corner of the * parent surface, in surface local coordinates. * * The flags argument controls details of the transient behaviour. */ static inline void wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TRANSIENT, parent, x, y, flags); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a fullscreen surface. * * If an output parameter is given then the surface will be made * fullscreen on that output. If the client does not specify the * output then the compositor will apply its policy - usually * choosing the output on which the surface has the biggest surface * area. * * The client may specify a method to resolve a size conflict * between the output size and the surface size - this is provided * through the method parameter. * * The framerate parameter is used only when the method is set * to "driver", to indicate the preferred framerate. A value of 0 * indicates that the app does not care about framerate. The * framerate is specified in mHz, that is framerate of 60000 is 60Hz. * * A method of "scale" or "driver" implies a scaling operation of * the surface, either via a direct scaling operation or a change of * the output mode. This will override any kind of output scaling, so * that mapping a surface with a buffer size equal to the mode can * fill the screen independent of buffer_scale. * * A method of "fill" means we don't scale up the buffer, however * any output scale is applied. This means that you may run into * an edge case where the application maps a buffer with the same * size of the output mode but buffer_scale 1 (thus making a * surface larger than the output). In this case it is allowed to * downscale the results to fit the screen. * * The compositor must reply to this request with a configure event * with the dimensions for the output on which the surface will * be made fullscreen. */ static inline void wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a popup. * * A popup surface is a transient surface with an added pointer * grab. * * An existing implicit grab will be changed to owner-events mode, * and the popup grab will continue after the implicit grab ends * (i.e. releasing the mouse button does not cause the popup to * be unmapped). * * The popup grab continues until the window is destroyed or a * mouse button is pressed in any other clients window. A click * in any of the clients surfaces is reported as normal, however, * clicks in other clients surfaces will be discarded and trigger * the callback. * * The x and y arguments specify the locations of the upper left * corner of the surface relative to the upper left corner of the * parent surface, in surface local coordinates. */ static inline void wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a maximized surface. * * If an output parameter is given then the surface will be * maximized on that output. If the client does not specify the * output then the compositor will apply its policy - usually * choosing the output on which the surface has the biggest surface * area. * * The compositor will reply with a configure event telling * the expected new surface size. The operation is completed * on the next buffer attach to this surface. * * A maximized surface typically fills the entire output it is * bound to, except for desktop element such as panels. This is * the main difference between a maximized shell surface and a * fullscreen shell surface. * * The details depend on the compositor implementation. */ static inline void wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_MAXIMIZED, output); } /** * @ingroup iface_wl_shell_surface * * Set a short title for the surface. * * This string may be used to identify the surface in a task bar, * window list, or other user interface elements provided by the * compositor. * * The string must be encoded in UTF-8. */ static inline void wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TITLE, title); } /** * @ingroup iface_wl_shell_surface * * Set a class for the surface. * * The surface class identifies the general class of applications * to which the surface belongs. A common convention is to use the * file name (or the full path if it is a non-standard location) of * the application's .desktop file as the class. */ static inline void wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_CLASS, class_); } #ifndef WL_SURFACE_ERROR_ENUM #define WL_SURFACE_ERROR_ENUM /** * @ingroup iface_wl_surface * wl_surface error values * * These errors can be emitted in response to wl_surface requests. */ enum wl_surface_error { /** * buffer scale value is invalid */ WL_SURFACE_ERROR_INVALID_SCALE = 0, /** * buffer transform value is invalid */ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1, }; #endif /* WL_SURFACE_ERROR_ENUM */ /** * @ingroup iface_wl_surface * @struct wl_surface_listener */ struct wl_surface_listener { /** * surface enters an output * * This is emitted whenever a surface's creation, movement, or * resizing results in some part of it being within the scanout * region of an output. * * Note that a surface may be overlapping with zero or more * outputs. */ void (*enter)(void *data, struct wl_surface *wl_surface, struct wl_output *output); /** * surface leaves an output * * This is emitted whenever a surface's creation, movement, or * resizing results in it no longer having any part of it within * the scanout region of an output. */ void (*leave)(void *data, struct wl_surface *wl_surface, struct wl_output *output); }; /** * @ingroup iface_wl_surface */ static inline int wl_surface_add_listener(struct wl_surface *wl_surface, const struct wl_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_surface, (void (**)(void)) listener, data); } #define WL_SURFACE_DESTROY 0 #define WL_SURFACE_ATTACH 1 #define WL_SURFACE_DAMAGE 2 #define WL_SURFACE_FRAME 3 #define WL_SURFACE_SET_OPAQUE_REGION 4 #define WL_SURFACE_SET_INPUT_REGION 5 #define WL_SURFACE_COMMIT 6 #define WL_SURFACE_SET_BUFFER_TRANSFORM 7 #define WL_SURFACE_SET_BUFFER_SCALE 8 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_ATTACH_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_DAMAGE_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_FRAME_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_COMMIT_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3 /** @ingroup iface_wl_surface */ static inline void wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data); } /** @ingroup iface_wl_surface */ static inline void * wl_surface_get_user_data(struct wl_surface *wl_surface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_surface); } static inline uint32_t wl_surface_get_version(struct wl_surface *wl_surface) { return wl_proxy_get_version((struct wl_proxy *) wl_surface); } /** * @ingroup iface_wl_surface * * Deletes the surface and invalidates its object ID. */ static inline void wl_surface_destroy(struct wl_surface *wl_surface) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_surface); } /** * @ingroup iface_wl_surface * * Set a buffer as the content of this surface. * * The new size of the surface is calculated based on the buffer * size transformed by the inverse buffer_transform and the * inverse buffer_scale. This means that the supplied buffer * must be an integer multiple of the buffer_scale. * * The x and y arguments specify the location of the new pending * buffer's upper left corner, relative to the current buffer's upper * left corner, in surface local coordinates. In other words, the * x and y, combined with the new surface size define in which * directions the surface's size changes. * * Surface contents are double-buffered state, see wl_surface.commit. * * The initial surface contents are void; there is no content. * wl_surface.attach assigns the given wl_buffer as the pending * wl_buffer. wl_surface.commit makes the pending wl_buffer the new * surface contents, and the size of the surface becomes the size * calculated from the wl_buffer, as described above. After commit, * there is no pending buffer until the next attach. * * Committing a pending wl_buffer allows the compositor to read the * pixels in the wl_buffer. The compositor may access the pixels at * any time after the wl_surface.commit request. When the compositor * will not access the pixels anymore, it will send the * wl_buffer.release event. Only after receiving wl_buffer.release, * the client may re-use the wl_buffer. A wl_buffer that has been * attached and then replaced by another attach instead of committed * will not receive a release event, and is not used by the * compositor. * * Destroying the wl_buffer after wl_buffer.release does not change * the surface contents. However, if the client destroys the * wl_buffer before receiving the wl_buffer.release event, the surface * contents become undefined immediately. * * If wl_surface.attach is sent with a NULL wl_buffer, the * following wl_surface.commit will remove the surface content. */ static inline void wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_ATTACH, buffer, x, y); } /** * @ingroup iface_wl_surface * * This request is used to describe the regions where the pending * buffer is different from the current surface contents, and where * the surface therefore needs to be repainted. The pending buffer * must be set by wl_surface.attach before sending damage. The * compositor ignores the parts of the damage that fall outside of * the surface. * * Damage is double-buffered state, see wl_surface.commit. * * The damage rectangle is specified in surface local coordinates. * * The initial value for pending damage is empty: no damage. * wl_surface.damage adds pending damage: the new pending damage * is the union of old pending damage and the given rectangle. * * wl_surface.commit assigns pending damage as the current damage, * and clears pending damage. The server will clear the current * damage as it repaints the surface. */ static inline void wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_DAMAGE, x, y, width, height); } /** * @ingroup iface_wl_surface * * Request a notification when it is a good time start drawing a new * frame, by creating a frame callback. This is useful for throttling * redrawing operations, and driving animations. * * When a client is animating on a wl_surface, it can use the 'frame' * request to get notified when it is a good time to draw and commit the * next frame of animation. If the client commits an update earlier than * that, it is likely that some updates will not make it to the display, * and the client is wasting resources by drawing too often. * * The frame request will take effect on the next wl_surface.commit. * The notification will only be posted for one frame unless * requested again. For a wl_surface, the notifications are posted in * the order the frame requests were committed. * * The server must send the notifications so that a client * will not send excessive updates, while still allowing * the highest possible update rate for clients that wait for the reply * before drawing again. The server should give some time for the client * to draw and commit after sending the frame callback events to let them * hit the next output refresh. * * A server should avoid signalling the frame callbacks if the * surface is not visible in any way, e.g. the surface is off-screen, * or completely obscured by other opaque surfaces. * * The object returned by this request will be destroyed by the * compositor after the callback is fired and as such the client must not * attempt to use it after that point. * * The callback_data passed in the callback is the current time, in * milliseconds, with an undefined base. */ static inline struct wl_callback * wl_surface_frame(struct wl_surface *wl_surface) { struct wl_proxy *callback; callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_surface, WL_SURFACE_FRAME, &wl_callback_interface, NULL); return (struct wl_callback *) callback; } /** * @ingroup iface_wl_surface * * This request sets the region of the surface that contains * opaque content. * * The opaque region is an optimization hint for the compositor * that lets it optimize out redrawing of content behind opaque * regions. Setting an opaque region is not required for correct * behaviour, but marking transparent content as opaque will result * in repaint artifacts. * * The opaque region is specified in surface local coordinates. * * The compositor ignores the parts of the opaque region that fall * outside of the surface. * * Opaque region is double-buffered state, see wl_surface.commit. * * wl_surface.set_opaque_region changes the pending opaque region. * wl_surface.commit copies the pending region to the current region. * Otherwise, the pending and current regions are never changed. * * The initial value for opaque region is empty. Setting the pending * opaque region has copy semantics, and the wl_region object can be * destroyed immediately. A NULL wl_region causes the pending opaque * region to be set to empty. */ static inline void wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_OPAQUE_REGION, region); } /** * @ingroup iface_wl_surface * * This request sets the region of the surface that can receive * pointer and touch events. * * Input events happening outside of this region will try the next * surface in the server surface stack. The compositor ignores the * parts of the input region that fall outside of the surface. * * The input region is specified in surface local coordinates. * * Input region is double-buffered state, see wl_surface.commit. * * wl_surface.set_input_region changes the pending input region. * wl_surface.commit copies the pending region to the current region. * Otherwise the pending and current regions are never changed, * except cursor and icon surfaces are special cases, see * wl_pointer.set_cursor and wl_data_device.start_drag. * * The initial value for input region is infinite. That means the * whole surface will accept input. Setting the pending input region * has copy semantics, and the wl_region object can be destroyed * immediately. A NULL wl_region causes the input region to be set * to infinite. */ static inline void wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_INPUT_REGION, region); } /** * @ingroup iface_wl_surface * * Surface state (input, opaque, and damage regions, attached buffers, * etc.) is double-buffered. Protocol requests modify the pending * state, as opposed to current state in use by the compositor. Commit * request atomically applies all pending state, replacing the current * state. After commit, the new pending state is as documented for each * related request. * * On commit, a pending wl_buffer is applied first, all other state * second. This means that all coordinates in double-buffered state are * relative to the new wl_buffer coming into use, except for * wl_surface.attach itself. If there is no pending wl_buffer, the * coordinates are relative to the current surface contents. * * All requests that need a commit to become effective are documented * to affect double-buffered state. * * Other interfaces may add further double-buffered surface state. */ static inline void wl_surface_commit(struct wl_surface *wl_surface) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_COMMIT); } /** * @ingroup iface_wl_surface * * This request sets an optional transformation on how the compositor * interprets the contents of the buffer attached to the surface. The * accepted values for the transform parameter are the values for * wl_output.transform. * * Buffer transform is double-buffered state, see wl_surface.commit. * * A newly created surface has its buffer transformation set to normal. * * wl_surface.set_buffer_transform changes the pending buffer * transformation. wl_surface.commit copies the pending buffer * transformation to the current one. Otherwise, the pending and current * values are never changed. * * The purpose of this request is to allow clients to render content * according to the output transform, thus permiting the compositor to * use certain optimizations even if the display is rotated. Using * hardware overlays and scanning out a client buffer for fullscreen * surfaces are examples of such optimizations. Those optimizations are * highly dependent on the compositor implementation, so the use of this * request should be considered on a case-by-case basis. * * Note that if the transform value includes 90 or 270 degree rotation, * the width of the buffer will become the surface height and the height * of the buffer will become the surface width. * * If transform is not one of the values from the * wl_output.transform enum the invalid_transform protocol error * is raised. */ static inline void wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_BUFFER_TRANSFORM, transform); } /** * @ingroup iface_wl_surface * * This request sets an optional scaling factor on how the compositor * interprets the contents of the buffer attached to the window. * * Buffer scale is double-buffered state, see wl_surface.commit. * * A newly created surface has its buffer scale set to 1. * * wl_surface.set_buffer_scale changes the pending buffer scale. * wl_surface.commit copies the pending buffer scale to the current one. * Otherwise, the pending and current values are never changed. * * The purpose of this request is to allow clients to supply higher * resolution buffer data for use on high resolution outputs. Its * intended that you pick the same buffer scale as the scale of the * output that the surface is displayed on.This means the compositor * can avoid scaling when rendering the surface on that output. * * Note that if the scale is larger than 1, then you have to attach * a buffer that is larger (by a factor of scale in each dimension) * than the desired surface size. * * If scale is not positive the invalid_scale protocol error is * raised. */ static inline void wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_BUFFER_SCALE, scale); } #ifndef WL_SEAT_CAPABILITY_ENUM #define WL_SEAT_CAPABILITY_ENUM /** * @ingroup iface_wl_seat * seat capability bitmask * * This is a bitmask of capabilities this seat has; if a member is * set, then it is present on the seat. */ enum wl_seat_capability { /** * The seat has pointer devices */ WL_SEAT_CAPABILITY_POINTER = 1, /** * The seat has one or more keyboards */ WL_SEAT_CAPABILITY_KEYBOARD = 2, /** * The seat has touch devices */ WL_SEAT_CAPABILITY_TOUCH = 4, }; #endif /* WL_SEAT_CAPABILITY_ENUM */ /** * @ingroup iface_wl_seat * @struct wl_seat_listener */ struct wl_seat_listener { /** * seat capabilities changed * * This is emitted whenever a seat gains or loses the pointer, * keyboard or touch capabilities. The argument is a capability * enum containing the complete set of capabilities this seat has. */ void (*capabilities)(void *data, struct wl_seat *wl_seat, uint32_t capabilities); /** * unique identifier for this seat * * In a multiseat configuration this can be used by the client to * help identify which physical devices the seat represents. Based * on the seat configuration used by the compositor. * @since 2 */ void (*name)(void *data, struct wl_seat *wl_seat, const char *name); }; /** * @ingroup iface_wl_seat */ static inline int wl_seat_add_listener(struct wl_seat *wl_seat, const struct wl_seat_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_seat, (void (**)(void)) listener, data); } #define WL_SEAT_GET_POINTER 0 #define WL_SEAT_GET_KEYBOARD 1 #define WL_SEAT_GET_TOUCH 2 /** * @ingroup iface_wl_seat */ #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_NAME_SINCE_VERSION 2 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_POINTER_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_TOUCH_SINCE_VERSION 1 /** @ingroup iface_wl_seat */ static inline void wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data); } /** @ingroup iface_wl_seat */ static inline void * wl_seat_get_user_data(struct wl_seat *wl_seat) { return wl_proxy_get_user_data((struct wl_proxy *) wl_seat); } static inline uint32_t wl_seat_get_version(struct wl_seat *wl_seat) { return wl_proxy_get_version((struct wl_proxy *) wl_seat); } /** @ingroup iface_wl_seat */ static inline void wl_seat_destroy(struct wl_seat *wl_seat) { wl_proxy_destroy((struct wl_proxy *) wl_seat); } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_pointer interface * for this seat. * * This request only takes effect if the seat has the pointer * capability. */ static inline struct wl_pointer * wl_seat_get_pointer(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_POINTER, &wl_pointer_interface, NULL); return (struct wl_pointer *) id; } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_keyboard interface * for this seat. * * This request only takes effect if the seat has the keyboard * capability. */ static inline struct wl_keyboard * wl_seat_get_keyboard(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, NULL); return (struct wl_keyboard *) id; } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_touch interface * for this seat. * * This request only takes effect if the seat has the touch * capability. */ static inline struct wl_touch * wl_seat_get_touch(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL); return (struct wl_touch *) id; } #ifndef WL_POINTER_BUTTON_STATE_ENUM #define WL_POINTER_BUTTON_STATE_ENUM /** * @ingroup iface_wl_pointer * physical button state * * Describes the physical state of a button which provoked the button * event. */ enum wl_pointer_button_state { /** * The button is not pressed */ WL_POINTER_BUTTON_STATE_RELEASED = 0, /** * The button is pressed */ WL_POINTER_BUTTON_STATE_PRESSED = 1, }; #endif /* WL_POINTER_BUTTON_STATE_ENUM */ #ifndef WL_POINTER_AXIS_ENUM #define WL_POINTER_AXIS_ENUM /** * @ingroup iface_wl_pointer * axis types * * Describes the axis types of scroll events. */ enum wl_pointer_axis { WL_POINTER_AXIS_VERTICAL_SCROLL = 0, WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, }; #endif /* WL_POINTER_AXIS_ENUM */ /** * @ingroup iface_wl_pointer * @struct wl_pointer_listener */ struct wl_pointer_listener { /** * enter event * * Notification that this seat's pointer is focused on a certain * surface. * * When an seat's focus enters a surface, the pointer image is * undefined and a client should respond to this event by setting * an appropriate pointer image with the set_cursor request. * @param surface_x x coordinate in surface-relative coordinates * @param surface_y y coordinate in surface-relative coordinates */ void (*enter)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); /** * leave event * * Notification that this seat's pointer is no longer focused on * a certain surface. * * The leave notification is sent before the enter notification for * the new focus. */ void (*leave)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface); /** * pointer motion event * * Notification of pointer location change. The arguments * surface_x and surface_y are the location relative to the focused * surface. * @param time timestamp with millisecond granularity * @param surface_x x coordinate in surface-relative coordinates * @param surface_y y coordinate in surface-relative coordinates */ void (*motion)(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); /** * pointer button event * * Mouse button click and release notifications. * * The location of the click is given by the last motion or enter * event. The time argument is a timestamp with millisecond * granularity, with an undefined base. * @param time timestamp with millisecond granularity */ void (*button)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state); /** * axis event * * Scroll and other axis notifications. * * For scroll events (vertical and horizontal scroll axes), the * value parameter is the length of a vector along the specified * axis in a coordinate space identical to those of motion events, * representing a relative movement along the specified axis. * * For devices that support movements non-parallel to axes multiple * axis events will be emitted. * * When applicable, for example for touch pads, the server can * choose to emit scroll events where the motion vector is * equivalent to a motion event vector. * * When applicable, clients can transform its view relative to the * scroll distance. * @param time timestamp with millisecond granularity */ void (*axis)(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value); }; /** * @ingroup iface_wl_pointer */ static inline int wl_pointer_add_listener(struct wl_pointer *wl_pointer, const struct wl_pointer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_pointer, (void (**)(void)) listener, data); } #define WL_POINTER_SET_CURSOR 0 #define WL_POINTER_RELEASE 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_BUTTON_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_AXIS_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_SET_CURSOR_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_pointer */ static inline void wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data); } /** @ingroup iface_wl_pointer */ static inline void * wl_pointer_get_user_data(struct wl_pointer *wl_pointer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer); } static inline uint32_t wl_pointer_get_version(struct wl_pointer *wl_pointer) { return wl_proxy_get_version((struct wl_proxy *) wl_pointer); } /** @ingroup iface_wl_pointer */ static inline void wl_pointer_destroy(struct wl_pointer *wl_pointer) { wl_proxy_destroy((struct wl_proxy *) wl_pointer); } /** * @ingroup iface_wl_pointer * * Set the pointer surface, i.e., the surface that contains the * pointer image (cursor). This request only takes effect if the pointer * focus for this device is one of the requesting client's surfaces * or the surface parameter is the current pointer surface. If * there was a previous surface set with this request it is * replaced. If surface is NULL, the pointer image is hidden. * * The parameters hotspot_x and hotspot_y define the position of * the pointer surface relative to the pointer location. Its * top-left corner is always at (x, y) - (hotspot_x, hotspot_y), * where (x, y) are the coordinates of the pointer location, in surface * local coordinates. * * On surface.attach requests to the pointer surface, hotspot_x * and hotspot_y are decremented by the x and y parameters * passed to the request. Attach must be confirmed by * wl_surface.commit as usual. * * The hotspot can also be updated by passing the currently set * pointer surface to this request with new values for hotspot_x * and hotspot_y. * * The current and pending input regions of the wl_surface are * cleared, and wl_surface.set_input_region is ignored until the * wl_surface is no longer used as the cursor. When the use as a * cursor ends, the current and pending input regions become * undefined, and the wl_surface is unmapped. */ static inline void wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y) { wl_proxy_marshal((struct wl_proxy *) wl_pointer, WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y); } /** * @ingroup iface_wl_pointer */ static inline void wl_pointer_release(struct wl_pointer *wl_pointer) { wl_proxy_marshal((struct wl_proxy *) wl_pointer, WL_POINTER_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_pointer); } #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM /** * @ingroup iface_wl_keyboard * keyboard mapping format * * This specifies the format of the keymap provided to the * client with the wl_keyboard.keymap event. */ enum wl_keyboard_keymap_format { /** * no keymap; client must understand how to interpret the raw keycode */ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0, /** * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode */ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1, }; #endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */ #ifndef WL_KEYBOARD_KEY_STATE_ENUM #define WL_KEYBOARD_KEY_STATE_ENUM /** * @ingroup iface_wl_keyboard * physical key state * * Describes the physical state of a key which provoked the key event. */ enum wl_keyboard_key_state { /** * key is not pressed */ WL_KEYBOARD_KEY_STATE_RELEASED = 0, /** * key is pressed */ WL_KEYBOARD_KEY_STATE_PRESSED = 1, }; #endif /* WL_KEYBOARD_KEY_STATE_ENUM */ /** * @ingroup iface_wl_keyboard * @struct wl_keyboard_listener */ struct wl_keyboard_listener { /** * keyboard mapping * * This event provides a file descriptor to the client which can * be memory-mapped to provide a keyboard mapping description. */ void (*keymap)(void *data, struct wl_keyboard *wl_keyboard, uint32_t format, int32_t fd, uint32_t size); /** * enter event * * Notification that this seat's keyboard focus is on a certain * surface. * @param keys the currently pressed keys */ void (*enter)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys); /** * leave event * * Notification that this seat's keyboard focus is no longer on a * certain surface. * * The leave notification is sent before the enter notification for * the new focus. */ void (*leave)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface); /** * key event * * A key was pressed or released. The time argument is a * timestamp with millisecond granularity, with an undefined base. * @param time timestamp with millisecond granularity */ void (*key)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); /** * modifier and group state * * Notifies clients that the modifier and/or group state has * changed, and it should update its local state. */ void (*modifiers)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); /** * repeat rate and delay * * Informs the client about the keyboard's repeat rate and delay. * * This event is sent as soon as the wl_keyboard object has been * created, and is guaranteed to be received by the client before * any key press event. * * Negative values for either rate or delay are illegal. A rate of * zero will disable any repeating (regardless of the value of * delay). * * This event can be sent later on as well with a new value if * necessary, so clients should continue listening for the event * past the creation of wl_keyboard. * @param rate the rate of repeating keys in characters per second * @param delay delay in milliseconds since key down until repeating starts * @since 4 */ void (*repeat_info)(void *data, struct wl_keyboard *wl_keyboard, int32_t rate, int32_t delay); }; /** * @ingroup iface_wl_keyboard */ static inline int wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard, const struct wl_keyboard_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard, (void (**)(void)) listener, data); } #define WL_KEYBOARD_RELEASE 0 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_KEY_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_keyboard */ static inline void wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data); } /** @ingroup iface_wl_keyboard */ static inline void * wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard) { return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard); } static inline uint32_t wl_keyboard_get_version(struct wl_keyboard *wl_keyboard) { return wl_proxy_get_version((struct wl_proxy *) wl_keyboard); } /** @ingroup iface_wl_keyboard */ static inline void wl_keyboard_destroy(struct wl_keyboard *wl_keyboard) { wl_proxy_destroy((struct wl_proxy *) wl_keyboard); } /** * @ingroup iface_wl_keyboard */ static inline void wl_keyboard_release(struct wl_keyboard *wl_keyboard) { wl_proxy_marshal((struct wl_proxy *) wl_keyboard, WL_KEYBOARD_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_keyboard); } /** * @ingroup iface_wl_touch * @struct wl_touch_listener */ struct wl_touch_listener { /** * touch down event and beginning of a touch sequence * * A new touch point has appeared on the surface. This touch * point is assigned a unique @id. Future events from this * touchpoint reference this ID. The ID ceases to be valid after a * touch up event and may be re-used in the future. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point * @param x x coordinate in surface-relative coordinates * @param y y coordinate in surface-relative coordinates */ void (*down)(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); /** * end of a touch event sequence * * The touch point has disappeared. No further events will be * sent for this touchpoint and the touch point's ID is released * and may be re-used in a future touch down event. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point */ void (*up)(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id); /** * update of touch point coordinates * * A touchpoint has changed coordinates. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point * @param x x coordinate in surface-relative coordinates * @param y y coordinate in surface-relative coordinates */ void (*motion)(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); /** * end of touch frame event * * Indicates the end of a contact point list. */ void (*frame)(void *data, struct wl_touch *wl_touch); /** * touch session cancelled * * Sent if the compositor decides the touch stream is a global * gesture. No further events are sent to the clients from that * particular gesture. Touch cancellation applies to all touch * points currently active on this client's surface. The client is * responsible for finalizing the touch points, future touch points * on this surface may re-use the touch point ID. */ void (*cancel)(void *data, struct wl_touch *wl_touch); }; /** * @ingroup iface_wl_touch */ static inline int wl_touch_add_listener(struct wl_touch *wl_touch, const struct wl_touch_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_touch, (void (**)(void)) listener, data); } #define WL_TOUCH_RELEASE 0 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_DOWN_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_UP_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_FRAME_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_CANCEL_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_touch */ static inline void wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data); } /** @ingroup iface_wl_touch */ static inline void * wl_touch_get_user_data(struct wl_touch *wl_touch) { return wl_proxy_get_user_data((struct wl_proxy *) wl_touch); } static inline uint32_t wl_touch_get_version(struct wl_touch *wl_touch) { return wl_proxy_get_version((struct wl_proxy *) wl_touch); } /** @ingroup iface_wl_touch */ static inline void wl_touch_destroy(struct wl_touch *wl_touch) { wl_proxy_destroy((struct wl_proxy *) wl_touch); } /** * @ingroup iface_wl_touch */ static inline void wl_touch_release(struct wl_touch *wl_touch) { wl_proxy_marshal((struct wl_proxy *) wl_touch, WL_TOUCH_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_touch); } #ifndef WL_OUTPUT_SUBPIXEL_ENUM #define WL_OUTPUT_SUBPIXEL_ENUM /** * @ingroup iface_wl_output * subpixel geometry information * * This enumeration describes how the physical * pixels on an output are layed out. */ enum wl_output_subpixel { WL_OUTPUT_SUBPIXEL_UNKNOWN = 0, WL_OUTPUT_SUBPIXEL_NONE = 1, WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2, WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3, WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4, WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5, }; #endif /* WL_OUTPUT_SUBPIXEL_ENUM */ #ifndef WL_OUTPUT_TRANSFORM_ENUM #define WL_OUTPUT_TRANSFORM_ENUM /** * @ingroup iface_wl_output * transform from framebuffer to output * * This describes the transform that a compositor will apply to a * surface to compensate for the rotation or mirroring of an * output device. * * The flipped values correspond to an initial flip around a * vertical axis followed by rotation. * * The purpose is mainly to allow clients render accordingly and * tell the compositor, so that for fullscreen surfaces, the * compositor will still be able to scan out directly from client * surfaces. */ enum wl_output_transform { WL_OUTPUT_TRANSFORM_NORMAL = 0, WL_OUTPUT_TRANSFORM_90 = 1, WL_OUTPUT_TRANSFORM_180 = 2, WL_OUTPUT_TRANSFORM_270 = 3, WL_OUTPUT_TRANSFORM_FLIPPED = 4, WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5, WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6, WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7, }; #endif /* WL_OUTPUT_TRANSFORM_ENUM */ #ifndef WL_OUTPUT_MODE_ENUM #define WL_OUTPUT_MODE_ENUM /** * @ingroup iface_wl_output * mode information * * These flags describe properties of an output mode. * They are used in the flags bitfield of the mode event. */ enum wl_output_mode { /** * indicates this is the current mode */ WL_OUTPUT_MODE_CURRENT = 0x1, /** * indicates this is the preferred mode */ WL_OUTPUT_MODE_PREFERRED = 0x2, }; #endif /* WL_OUTPUT_MODE_ENUM */ /** * @ingroup iface_wl_output * @struct wl_output_listener */ struct wl_output_listener { /** * properties of the output * * The geometry event describes geometric properties of the * output. The event is sent when binding to the output object and * whenever any of the properties change. * @param x x position within the global compositor space * @param y y position within the global compositor space * @param physical_width width in millimeters of the output * @param physical_height height in millimeters of the output * @param subpixel subpixel orientation of the output * @param make textual description of the manufacturer * @param model textual description of the model * @param transform transform that maps framebuffer to output */ void (*geometry)(void *data, struct wl_output *wl_output, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform); /** * advertise available modes for the output * * The mode event describes an available mode for the output. * * The event is sent when binding to the output object and there * will always be one mode, the current mode. The event is sent * again if an output changes mode, for the mode that is now * current. In other words, the current mode is always the last * mode that was received with the current flag set. * * The size of a mode is given in physical hardware units of the * output device. This is not necessarily the same as the output * size in the global compositor space. For instance, the output * may be scaled, as described in wl_output.scale, or transformed , * as described in wl_output.transform. * @param flags bitfield of mode flags * @param width width of the mode in hardware units * @param height height of the mode in hardware units * @param refresh vertical refresh rate in mHz */ void (*mode)(void *data, struct wl_output *wl_output, uint32_t flags, int32_t width, int32_t height, int32_t refresh); /** * sent all information about output * * This event is sent after all other properties has been sent * after binding to the output object and after any other property * changes done after that. This allows changes to the output * properties to be seen as atomic, even if they happen via * multiple events. * @since 2 */ void (*done)(void *data, struct wl_output *wl_output); /** * output scaling properties * * This event contains scaling geometry information that is not * in the geometry event. It may be sent after binding the output * object or if the output scale changes later. If it is not sent, * the client should assume a scale of 1. * * A scale larger than 1 means that the compositor will * automatically scale surface buffers by this amount when * rendering. This is used for very high resolution displays where * applications rendering at the native resolution would be too * small to be legible. * * It is intended that scaling aware clients track the current * output of a surface, and if it is on a scaled output it should * use wl_surface.set_buffer_scale with the scale of the output. * That way the compositor can avoid scaling the surface, and the * client can supply a higher detail image. * @param factor scaling factor of output * @since 2 */ void (*scale)(void *data, struct wl_output *wl_output, int32_t factor); }; /** * @ingroup iface_wl_output */ static inline int wl_output_add_listener(struct wl_output *wl_output, const struct wl_output_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_output, (void (**)(void)) listener, data); } /** * @ingroup iface_wl_output */ #define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_MODE_SINCE_VERSION 1 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_DONE_SINCE_VERSION 2 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_SCALE_SINCE_VERSION 2 /** @ingroup iface_wl_output */ static inline void wl_output_set_user_data(struct wl_output *wl_output, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data); } /** @ingroup iface_wl_output */ static inline void * wl_output_get_user_data(struct wl_output *wl_output) { return wl_proxy_get_user_data((struct wl_proxy *) wl_output); } static inline uint32_t wl_output_get_version(struct wl_output *wl_output) { return wl_proxy_get_version((struct wl_proxy *) wl_output); } /** @ingroup iface_wl_output */ static inline void wl_output_destroy(struct wl_output *wl_output) { wl_proxy_destroy((struct wl_proxy *) wl_output); } #define WL_REGION_DESTROY 0 #define WL_REGION_ADD 1 #define WL_REGION_SUBTRACT 2 /** * @ingroup iface_wl_region */ #define WL_REGION_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_region */ #define WL_REGION_ADD_SINCE_VERSION 1 /** * @ingroup iface_wl_region */ #define WL_REGION_SUBTRACT_SINCE_VERSION 1 /** @ingroup iface_wl_region */ static inline void wl_region_set_user_data(struct wl_region *wl_region, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data); } /** @ingroup iface_wl_region */ static inline void * wl_region_get_user_data(struct wl_region *wl_region) { return wl_proxy_get_user_data((struct wl_proxy *) wl_region); } static inline uint32_t wl_region_get_version(struct wl_region *wl_region) { return wl_proxy_get_version((struct wl_proxy *) wl_region); } /** * @ingroup iface_wl_region * * Destroy the region. This will invalidate the object ID. */ static inline void wl_region_destroy(struct wl_region *wl_region) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_region); } /** * @ingroup iface_wl_region * * Add the specified rectangle to the region. */ static inline void wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_ADD, x, y, width, height); } /** * @ingroup iface_wl_region * * Subtract the specified rectangle from the region. */ static inline void wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_SUBTRACT, x, y, width, height); } #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM #define WL_SUBCOMPOSITOR_ERROR_ENUM enum wl_subcompositor_error { /** * the to-be sub-surface is invalid */ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ #define WL_SUBCOMPOSITOR_DESTROY 0 #define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 /** * @ingroup iface_wl_subcompositor */ #define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_subcompositor */ #define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1 /** @ingroup iface_wl_subcompositor */ static inline void wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); } /** @ingroup iface_wl_subcompositor */ static inline void * wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor) { return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); } static inline uint32_t wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor) { return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor); } /** * @ingroup iface_wl_subcompositor * * Informs the server that the client will not be using this * protocol object anymore. This does not affect any other * objects, wl_subsurface objects included. */ static inline void wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) { wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, WL_SUBCOMPOSITOR_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); } /** * @ingroup iface_wl_subcompositor * * Create a sub-surface interface for the given surface, and * associate it with the given parent surface. This turns a * plain wl_surface into a sub-surface. * * The to-be sub-surface must not already have a dedicated * purpose, like any shell surface type, cursor image, drag icon, * or sub-surface. Otherwise a protocol error is raised. */ static inline struct wl_subsurface * wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_subcompositor, WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, NULL, surface, parent); return (struct wl_subsurface *) id; } #ifndef WL_SUBSURFACE_ERROR_ENUM #define WL_SUBSURFACE_ERROR_ENUM enum wl_subsurface_error { /** * wl_surface is not a sibling or the parent */ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBSURFACE_ERROR_ENUM */ #define WL_SUBSURFACE_DESTROY 0 #define WL_SUBSURFACE_SET_POSITION 1 #define WL_SUBSURFACE_PLACE_ABOVE 2 #define WL_SUBSURFACE_PLACE_BELOW 3 #define WL_SUBSURFACE_SET_SYNC 4 #define WL_SUBSURFACE_SET_DESYNC 5 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1 /** @ingroup iface_wl_subsurface */ static inline void wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); } /** @ingroup iface_wl_subsurface */ static inline void * wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); } static inline uint32_t wl_subsurface_get_version(struct wl_subsurface *wl_subsurface) { return wl_proxy_get_version((struct wl_proxy *) wl_subsurface); } /** * @ingroup iface_wl_subsurface * * The sub-surface interface is removed from the wl_surface object * that was turned into a sub-surface with * wl_subcompositor.get_subsurface request. The wl_surface's association * to the parent is deleted, and the wl_surface loses its role as * a sub-surface. The wl_surface is unmapped. */ static inline void wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_subsurface); } /** * @ingroup iface_wl_subsurface * * This schedules a sub-surface position change. * The sub-surface will be moved so, that its origin (top-left * corner pixel) will be at the location x, y of the parent surface * coordinate system. The coordinates are not restricted to the parent * surface area. Negative values are allowed. * * The next wl_surface.commit on the parent surface will reset * the sub-surface's position to the scheduled coordinates. * * If more than one set_position request is invoked by the client before * the commit of the parent surface, the position of a new request always * replaces the scheduled position from any previous request. * * The initial position is 0, 0. */ static inline void wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_POSITION, x, y); } /** * @ingroup iface_wl_subsurface * * This sub-surface is taken from the stack, and put back just * above the reference surface, changing the z-order of the sub-surfaces. * The reference surface must be one of the sibling surfaces, or the * parent surface. Using any other surface, including this sub-surface, * will cause a protocol error. * * The z-order is double-buffered. Requests are handled in order and * applied immediately to a pending state, then committed to the active * state on the next commit of the parent surface. * See wl_surface.commit and wl_subcompositor.get_subsurface. * * A new sub-surface is initially added as the top-most in the stack * of its siblings and parent. */ static inline void wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_PLACE_ABOVE, sibling); } /** * @ingroup iface_wl_subsurface * * The sub-surface is placed just below of the reference surface. * See wl_subsurface.place_above. */ static inline void wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_PLACE_BELOW, sibling); } /** * @ingroup iface_wl_subsurface * * Change the commit behaviour of the sub-surface to synchronized * mode, also described as the parent dependant mode. * * In synchronized mode, wl_surface.commit on a sub-surface will * accumulate the committed state in a cache, but the state will * not be applied and hence will not change the compositor output. * The cached state is applied to the sub-surface immediately after * the parent surface's state is applied. This ensures atomic * updates of the parent and all its synchronized sub-surfaces. * Applying the cached state will invalidate the cache, so further * parent surface commits do not (re-)apply old state. * * See wl_subsurface for the recursive effect of this mode. */ static inline void wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_SYNC); } /** * @ingroup iface_wl_subsurface * * Change the commit behaviour of the sub-surface to desynchronized * mode, also described as independent or freely running mode. * * In desynchronized mode, wl_surface.commit on a sub-surface will * apply the pending state directly, without caching, as happens * normally with a wl_surface. Calling wl_surface.commit on the * parent surface has no effect on the sub-surface's wl_surface * state. This mode allows a sub-surface to be updated on its own. * * If cached state exists when wl_surface.commit is called in * desynchronized mode, the pending state is added to the cached * state, and applied as whole. This invalidates the cache. * * Note: even if a sub-surface is set to desynchronized, a parent * sub-surface may override it to behave as synchronized. For details, * see wl_subsurface. * * If a surface's parent surface behaves as desynchronized, then * the cached state is applied on set_desync. */ static inline void wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_DESYNC); } #ifdef __cplusplus } #endif #endif wayland-xdg-output-unstable-v1-client-protocol.h000066400000000000000000000322421476226662200403650ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #define XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_xdg_output_unstable_v1 The xdg_output_unstable_v1 protocol * Protocol to describe output regions * * @section page_desc_xdg_output_unstable_v1 Description * * This protocol aims at describing outputs in a way which is more in line * with the concept of an output on desktop oriented systems. * * Some information are more specific to the concept of an output for * a desktop oriented system and may not make sense in other applications, * such as IVI systems for example. * * Typically, the global compositor space on a desktop system is made of * a contiguous or overlapping set of rectangular regions. * * Some of the information provided in this protocol might be identical * to their counterparts already available from wl_output, in which case * the information provided by this protocol should be preferred to their * equivalent in wl_output. The goal is to move the desktop specific * concepts (such as output location within the global compositor space, * the connector name and types, etc.) out of the core wl_output protocol. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible * changes may be added together with the corresponding interface * version bump. * Backward incompatible changes are done by bumping the version * number in the protocol and interface names and resetting the * interface version. Once the protocol is to be declared stable, * the 'z' prefix and the version number in the protocol and * interface names are removed and the interface version number is * reset. * * @section page_ifaces_xdg_output_unstable_v1 Interfaces * - @subpage page_iface_zxdg_output_manager_v1 - manage xdg_output objects * - @subpage page_iface_zxdg_output_v1 - compositor logical output region * @section page_copyright_xdg_output_unstable_v1 Copyright *
 *
 * Copyright © 2017 Red Hat Inc.
 *
 * 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 (including the next
 * paragraph) 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.
 * 
*/ struct wl_output; struct zxdg_output_manager_v1; struct zxdg_output_v1; /** * @page page_iface_zxdg_output_manager_v1 zxdg_output_manager_v1 * @section page_iface_zxdg_output_manager_v1_desc Description * * A global factory interface for xdg_output objects. * @section page_iface_zxdg_output_manager_v1_api API * See @ref iface_zxdg_output_manager_v1. */ /** * @defgroup iface_zxdg_output_manager_v1 The zxdg_output_manager_v1 interface * * A global factory interface for xdg_output objects. */ extern const struct wl_interface zxdg_output_manager_v1_interface; /** * @page page_iface_zxdg_output_v1 zxdg_output_v1 * @section page_iface_zxdg_output_v1_desc Description * * An xdg_output describes part of the compositor geometry. * * This typically corresponds to a monitor that displays part of the * compositor space. * @section page_iface_zxdg_output_v1_api API * See @ref iface_zxdg_output_v1. */ /** * @defgroup iface_zxdg_output_v1 The zxdg_output_v1 interface * * An xdg_output describes part of the compositor geometry. * * This typically corresponds to a monitor that displays part of the * compositor space. */ extern const struct wl_interface zxdg_output_v1_interface; #define ZXDG_OUTPUT_MANAGER_V1_DESTROY 0 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT 1 /** * @ingroup iface_zxdg_output_manager_v1 */ #define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_manager_v1 */ #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1 /** @ingroup iface_zxdg_output_manager_v1 */ static inline void zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_manager_v1, user_data); } /** @ingroup iface_zxdg_output_manager_v1 */ static inline void * zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_manager_v1); } static inline uint32_t zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { return wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1); } /** * @ingroup iface_zxdg_output_manager_v1 * * Using this request a client can tell the server that it is not * going to use the xdg_output_manager object anymore. * * Any objects already created through this instance are not affected. */ static inline void zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { wl_proxy_marshal((struct wl_proxy *) zxdg_output_manager_v1, ZXDG_OUTPUT_MANAGER_V1_DESTROY); wl_proxy_destroy((struct wl_proxy *) zxdg_output_manager_v1); } /** * @ingroup iface_zxdg_output_manager_v1 * * This creates a new xdg_output object for the given wl_output. */ static inline struct zxdg_output_v1 * zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, struct wl_output *output) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_output_manager_v1, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, NULL, output); return (struct zxdg_output_v1 *) id; } /** * @ingroup iface_zxdg_output_v1 * @struct zxdg_output_v1_listener */ struct zxdg_output_v1_listener { /** * position of the output within the global compositor space * * The position event describes the location of the wl_output * within the global compositor space. * * The logical_position event is sent after creating an xdg_output * (see xdg_output_manager.get_xdg_output) and whenever the * location of the output changes within the global compositor * space. * @param x x position within the global compositor space * @param y y position within the global compositor space */ void (*logical_position)(void *data, struct zxdg_output_v1 *zxdg_output_v1, int32_t x, int32_t y); /** * size of the output in the global compositor space * * The logical_size event describes the size of the output in the * global compositor space. * * For example, a surface without any buffer scale, transformation * nor rotation set, with the size matching the logical_size will * have the same size as the corresponding output when displayed. * * Most regular Wayland clients should not pay attention to the * logical size and would rather rely on xdg_shell interfaces. * * Some clients such as Xwayland, however, need this to configure * their surfaces in the global compositor space as the compositor * may apply a different scale from what is advertised by the * output scaling property (to achieve fractional scaling, for * example). * * For example, for a wl_output mode 3840×2160 and a scale factor * 2: * * - A compositor not scaling the surface buffers will advertise a * logical size of 3840×2160, * * - A compositor automatically scaling the surface buffers will * advertise a logical size of 1920×1080, * * - A compositor using a fractional scale of 1.5 will advertise a * logical size to 2560×1620. * * For example, for a wl_output mode 1920×1080 and a 90 degree * rotation, the compositor will advertise a logical size of * 1080x1920. * * The logical_size event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output) and whenever the logical size * of the output changes, either as a result of a change in the * applied scale or because of a change in the corresponding output * mode(see wl_output.mode) or transform (see wl_output.transform). * @param width width in global compositor space * @param height height in global compositor space */ void (*logical_size)(void *data, struct zxdg_output_v1 *zxdg_output_v1, int32_t width, int32_t height); /** * all information about the output have been sent * * This event is sent after all other properties of an xdg_output * have been sent. * * This allows changes to the xdg_output properties to be seen as * atomic, even if they happen via multiple events. */ void (*done)(void *data, struct zxdg_output_v1 *zxdg_output_v1); /** * name of this output * * Many compositors will assign names to their outputs, show them * to the user, allow them to be configured by name, etc. The * client may wish to know this name as well to offer the user * similar behaviors. * * The naming convention is compositor defined, but limited to * alphanumeric characters and dashes (-). Each name is unique * among all wl_output globals, but if a wl_output global is * destroyed the same name may be reused later. The names will also * remain consistent across sessions with the same hardware and * software configuration. * * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. * However, do not assume that the name is a reflection of an * underlying DRM connector, X11 connection, etc. * * The name event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output). This event is only sent once * per xdg_output, and the name does not change over the lifetime * of the wl_output global. * @param name output name * @since 2 */ void (*name)(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *name); /** * human-readable description of this output * * Many compositors can produce human-readable descriptions of * their outputs. The client may wish to know this description as * well, to communicate the user for various purposes. * * The description is a UTF-8 string with no convention defined for * its contents. Examples might include 'Foocorp 11" Display' or * 'Virtual X11 output via :1'. * * The description event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output). This event is only sent once * per xdg_output, and the description does not change over the * lifetime of the wl_output global. The description is optional, * and may not be sent at all. * @param description output description * @since 2 */ void (*description)(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *description); }; /** * @ingroup iface_zxdg_output_v1 */ static inline int zxdg_output_v1_add_listener(struct zxdg_output_v1 *zxdg_output_v1, const struct zxdg_output_v1_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zxdg_output_v1, (void (**)(void)) listener, data); } #define ZXDG_OUTPUT_V1_DESTROY 0 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zxdg_output_v1 */ static inline void zxdg_output_v1_set_user_data(struct zxdg_output_v1 *zxdg_output_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_v1, user_data); } /** @ingroup iface_zxdg_output_v1 */ static inline void * zxdg_output_v1_get_user_data(struct zxdg_output_v1 *zxdg_output_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_v1); } static inline uint32_t zxdg_output_v1_get_version(struct zxdg_output_v1 *zxdg_output_v1) { return wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1); } /** * @ingroup iface_zxdg_output_v1 * * Using this request a client can tell the server that it is not * going to use the xdg_output object anymore. */ static inline void zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1) { wl_proxy_marshal((struct wl_proxy *) zxdg_output_v1, ZXDG_OUTPUT_V1_DESTROY); wl_proxy_destroy((struct wl_proxy *) zxdg_output_v1); } #ifdef __cplusplus } #endif #endif qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/000077500000000000000000000000001476226662200225265ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/000077500000000000000000000000001476226662200255715ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/000077500000000000000000000000001476226662200272435ustar00rootroot00000000000000qtwaylandclient-config.h000066400000000000000000000001671476226662200340070ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later qtwaylandclient-config_p.h000066400000000000000000000006401476226662200343220ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #define QT_FEATURE_wayland_client 1 #define QT_FEATURE_drm_egl_server 1 #define QT_FEATURE_libhybris_egl_server -1 #define QT_FEATURE_wayland_brcm -1 #define QT_FEATURE_wayland_datadevice 1 #define QT_FEATURE_wayland_egl 1 #define QT_FEATURE_xcomposite_egl 1 #define QT_FEATURE_xcomposite_glx -1 qtwaylandclientglobal.h000066400000000000000000000013661476226662200337270ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTGLOBAL_H #define QWAYLANDCLIENTGLOBAL_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE #if !defined(Q_WAYLAND_CLIENT_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_EXPORT # endif #endif QT_END_NAMESPACE #endif //QWAYLANDCLIENTGLOBAL_H qtwaylandclientglobal_p.h000066400000000000000000000011571476226662200342440ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTGLOBAL_P_H #define QWAYLANDCLIENTGLOBAL_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #endif //QWAYLANDCLIENTGLOBAL_P_H qwayland-hardware-integration.h000066400000000000000000000041731476226662200352760ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_HARDWARE_INTEGRATION #define QT_WAYLAND_HARDWARE_INTEGRATION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_HARDWARE_INTEGRATION_EXPORT qt_hardware_integration { public: qt_hardware_integration(struct ::wl_registry *registry, int id, int version); qt_hardware_integration(struct ::qt_hardware_integration *object); qt_hardware_integration(); virtual ~qt_hardware_integration(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_hardware_integration *object); struct ::qt_hardware_integration *object() { return m_qt_hardware_integration; } const struct ::qt_hardware_integration *object() const { return m_qt_hardware_integration; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void hardware_integration_client_backend(const QString &name); virtual void hardware_integration_server_backend(const QString &name); private: void init_listener(); static const struct qt_hardware_integration_listener m_qt_hardware_integration_listener; static void handle_client_backend( void *data, struct ::qt_hardware_integration *object, const char *name); static void handle_server_backend( void *data, struct ::qt_hardware_integration *object, const char *name); struct ::qt_hardware_integration *m_qt_hardware_integration; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-qt-key-unstable-v1.h000066400000000000000000000042601476226662200345260ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_QT_KEY_UNSTABLE_V1 #define QT_WAYLAND_QT_KEY_UNSTABLE_V1 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_QT_KEY_UNSTABLE_V1_EXPORT zqt_key_v1 { public: zqt_key_v1(struct ::wl_registry *registry, int id, int version); zqt_key_v1(struct ::zqt_key_v1 *object); zqt_key_v1(); virtual ~zqt_key_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zqt_key_v1 *object); struct ::zqt_key_v1 *object() { return m_zqt_key_v1; } const struct ::zqt_key_v1 *object() const { return m_zqt_key_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void zqt_key_v1_key(struct ::wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const QString &text, uint32_t autorepeat, uint32_t count); private: void init_listener(); static const struct zqt_key_v1_listener m_zqt_key_v1_listener; static void handle_key( void *data, struct ::zqt_key_v1 *object, struct ::wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const char *text, uint32_t autorepeat, uint32_t count); struct ::zqt_key_v1 *m_zqt_key_v1; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-qt-windowmanager.h000066400000000000000000000037241476226662200344450ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_QT_WINDOWMANAGER #define QT_WAYLAND_QT_WINDOWMANAGER #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_QT_WINDOWMANAGER_EXPORT qt_windowmanager { public: qt_windowmanager(struct ::wl_registry *registry, int id, int version); qt_windowmanager(struct ::qt_windowmanager *object); qt_windowmanager(); virtual ~qt_windowmanager(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_windowmanager *object); struct ::qt_windowmanager *object() { return m_qt_windowmanager; } const struct ::qt_windowmanager *object() const { return m_qt_windowmanager; } bool isInitialized() const; static const struct ::wl_interface *interface(); void open_url(uint32_t remaining, const QString &url); protected: virtual void windowmanager_hints(int32_t show_is_fullscreen); virtual void windowmanager_quit(); private: void init_listener(); static const struct qt_windowmanager_listener m_qt_windowmanager_listener; static void handle_hints( void *data, struct ::qt_windowmanager *object, int32_t show_is_fullscreen); static void handle_quit( void *data, struct ::qt_windowmanager *object); struct ::qt_windowmanager *m_qt_windowmanager; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-server-buffer-extension.h000066400000000000000000000027611476226662200357500ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_SERVER_BUFFER_EXTENSION #define QT_WAYLAND_SERVER_BUFFER_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_SERVER_BUFFER_EXTENSION_EXPORT qt_server_buffer { public: qt_server_buffer(struct ::wl_registry *registry, int id, int version); qt_server_buffer(struct ::qt_server_buffer *object); qt_server_buffer(); virtual ~qt_server_buffer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_server_buffer *object); struct ::qt_server_buffer *object() { return m_qt_server_buffer; } const struct ::qt_server_buffer *object() const { return m_qt_server_buffer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void release(); private: struct ::qt_server_buffer *m_qt_server_buffer; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-surface-extension.h000066400000000000000000000075021476226662200346210ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_SURFACE_EXTENSION #define QT_WAYLAND_SURFACE_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT qt_surface_extension { public: qt_surface_extension(struct ::wl_registry *registry, int id, int version); qt_surface_extension(struct ::qt_surface_extension *object); qt_surface_extension(); virtual ~qt_surface_extension(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_surface_extension *object); struct ::qt_surface_extension *object() { return m_qt_surface_extension; } const struct ::qt_surface_extension *object() const { return m_qt_surface_extension; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::qt_extended_surface *get_extended_surface(struct ::wl_surface *surface); private: struct ::qt_surface_extension *m_qt_surface_extension; }; class Q_WAYLAND_CLIENT_SURFACE_EXTENSION_EXPORT qt_extended_surface { public: qt_extended_surface(struct ::wl_registry *registry, int id, int version); qt_extended_surface(struct ::qt_extended_surface *object); qt_extended_surface(); virtual ~qt_extended_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_extended_surface *object); struct ::qt_extended_surface *object() { return m_qt_extended_surface; } const struct ::qt_extended_surface *object() const { return m_qt_extended_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum orientation { orientation_PrimaryOrientation = 0, orientation_PortraitOrientation = 1, orientation_LandscapeOrientation = 2, orientation_InvertedPortraitOrientation = 4, orientation_InvertedLandscapeOrientation = 8 }; enum windowflag { windowflag_OverridesSystemGestures = 1, windowflag_StaysOnTop = 2, windowflag_BypassWindowManager = 4 }; void update_generic_property(const QString &name, const QByteArray &value); void set_content_orientation_mask(int32_t orientation); void set_window_flags(int32_t flags); void raise(); void lower(); protected: virtual void extended_surface_onscreen_visibility(int32_t visible); virtual void extended_surface_set_generic_property(const QString &name, wl_array *value); virtual void extended_surface_close(); private: void init_listener(); static const struct qt_extended_surface_listener m_qt_extended_surface_listener; static void handle_onscreen_visibility( void *data, struct ::qt_extended_surface *object, int32_t visible); static void handle_set_generic_property( void *data, struct ::qt_extended_surface *object, const char *name, wl_array *value); static void handle_close( void *data, struct ::qt_extended_surface *object); struct ::qt_extended_surface *m_qt_extended_surface; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-text-input-unstable-v2.h000066400000000000000000000247361476226662200354500ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_TEXT_INPUT_UNSTABLE_V2 #define QT_WAYLAND_TEXT_INPUT_UNSTABLE_V2 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT zwp_text_input_v2 { public: zwp_text_input_v2(struct ::wl_registry *registry, int id, int version); zwp_text_input_v2(struct ::zwp_text_input_v2 *object); zwp_text_input_v2(); virtual ~zwp_text_input_v2(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zwp_text_input_v2 *object); struct ::zwp_text_input_v2 *object() { return m_zwp_text_input_v2; } const struct ::zwp_text_input_v2 *object() const { return m_zwp_text_input_v2; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum content_hint { content_hint_none = 0x0, // no special behaviour content_hint_auto_completion = 0x1, // suggest word completions content_hint_auto_correction = 0x2, // suggest word corrections content_hint_auto_capitalization = 0x4, // switch to uppercase letters at the start of a sentence content_hint_lowercase = 0x8, // prefer lowercase letters content_hint_uppercase = 0x10, // prefer uppercase letters content_hint_titlecase = 0x20, // prefer casing for titles and headings (can be language dependent) content_hint_hidden_text = 0x40, // characters should be hidden content_hint_sensitive_data = 0x80, // typed text should not be stored content_hint_latin = 0x100, // just latin characters should be entered content_hint_multiline = 0x200 // the text input is multiline }; enum content_purpose { content_purpose_normal = 0, // default input, allowing all characters content_purpose_alpha = 1, // allow only alphabetic characters content_purpose_digits = 2, // allow only digits content_purpose_number = 3, // input a number (including decimal separator and sign) content_purpose_phone = 4, // input a phone number content_purpose_url = 5, // input an URL content_purpose_email = 6, // input an email address content_purpose_name = 7, // input a name of a person content_purpose_password = 8, // input a password (combine with password or sensitive_data hint) content_purpose_date = 9, // input a date content_purpose_time = 10, // input a time content_purpose_datetime = 11, // input a date and time content_purpose_terminal = 12 // input for a terminal }; enum update_state { update_state_change = 0, // updated state because it changed update_state_full = 1, // full state after enter or input_method_changed event update_state_reset = 2, // full state after reset update_state_enter = 3 // full state after switching focus to a different widget on client side }; enum input_panel_visibility { input_panel_visibility_hidden = 0, // the input panel (virtual keyboard) is hidden input_panel_visibility_visible = 1 // the input panel (virtual keyboard) is visible }; enum preedit_style { preedit_style_default = 0, // default style for composing text preedit_style_none = 1, // composing text should be shown the same as non-composing text preedit_style_active = 2, // composing text might be bold preedit_style_inactive = 3, // composing text might be cursive preedit_style_highlight = 4, // composing text might have a different background color preedit_style_underline = 5, // composing text might be underlined preedit_style_selection = 6, // composing text should be shown the same as selected text preedit_style_incorrect = 7 // composing text might be underlined with a red wavy line }; enum text_direction { text_direction_auto = 0, // automatic text direction based on text and language text_direction_ltr = 1, // left-to-right text_direction_rtl = 2 // right-to-left }; void destroy(); void enable(struct ::wl_surface *surface); void disable(struct ::wl_surface *surface); void show_input_panel(); void hide_input_panel(); void set_surrounding_text(const QString &text, int32_t cursor, int32_t anchor); void set_content_type(uint32_t hint, uint32_t purpose); void set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height); void set_preferred_language(const QString &language); void update_state(uint32_t serial, uint32_t reason); protected: virtual void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface); virtual void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface); virtual void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); virtual void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit); virtual void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style); virtual void zwp_text_input_v2_preedit_cursor(int32_t index); virtual void zwp_text_input_v2_commit_string(const QString &text); virtual void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor); virtual void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length); virtual void zwp_text_input_v2_modifiers_map(wl_array *map); virtual void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); virtual void zwp_text_input_v2_language(const QString &language); virtual void zwp_text_input_v2_text_direction(uint32_t direction); virtual void zwp_text_input_v2_configure_surrounding_text(int32_t before_cursor, int32_t after_cursor); virtual void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags); private: void init_listener(); static const struct zwp_text_input_v2_listener m_zwp_text_input_v2_listener; static void handle_enter( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, struct ::wl_surface *surface); static void handle_leave( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, struct ::wl_surface *surface); static void handle_input_panel_state( void *data, struct ::zwp_text_input_v2 *object, uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); static void handle_preedit_string( void *data, struct ::zwp_text_input_v2 *object, const char *text, const char *commit); static void handle_preedit_styling( void *data, struct ::zwp_text_input_v2 *object, uint32_t index, uint32_t length, uint32_t style); static void handle_preedit_cursor( void *data, struct ::zwp_text_input_v2 *object, int32_t index); static void handle_commit_string( void *data, struct ::zwp_text_input_v2 *object, const char *text); static void handle_cursor_position( void *data, struct ::zwp_text_input_v2 *object, int32_t index, int32_t anchor); static void handle_delete_surrounding_text( void *data, struct ::zwp_text_input_v2 *object, uint32_t before_length, uint32_t after_length); static void handle_modifiers_map( void *data, struct ::zwp_text_input_v2 *object, wl_array *map); static void handle_keysym( void *data, struct ::zwp_text_input_v2 *object, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); static void handle_language( void *data, struct ::zwp_text_input_v2 *object, const char *language); static void handle_text_direction( void *data, struct ::zwp_text_input_v2 *object, uint32_t direction); static void handle_configure_surrounding_text( void *data, struct ::zwp_text_input_v2 *object, int32_t before_cursor, int32_t after_cursor); static void handle_input_method_changed( void *data, struct ::zwp_text_input_v2 *object, uint32_t serial, uint32_t flags); struct ::zwp_text_input_v2 *m_zwp_text_input_v2; }; class Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V2_EXPORT zwp_text_input_manager_v2 { public: zwp_text_input_manager_v2(struct ::wl_registry *registry, int id, int version); zwp_text_input_manager_v2(struct ::zwp_text_input_manager_v2 *object); zwp_text_input_manager_v2(); virtual ~zwp_text_input_manager_v2(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zwp_text_input_manager_v2 *object); struct ::zwp_text_input_manager_v2 *object() { return m_zwp_text_input_manager_v2; } const struct ::zwp_text_input_manager_v2 *object() const { return m_zwp_text_input_manager_v2; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); struct ::zwp_text_input_v2 *get_text_input(struct ::wl_seat *seat); private: struct ::zwp_text_input_manager_v2 *m_zwp_text_input_manager_v2; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-touch-extension.h000066400000000000000000000052021476226662200343060ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_TOUCH_EXTENSION #define QT_WAYLAND_TOUCH_EXTENSION #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_TOUCH_EXTENSION_EXPORT qt_touch_extension { public: qt_touch_extension(struct ::wl_registry *registry, int id, int version); qt_touch_extension(struct ::qt_touch_extension *object); qt_touch_extension(); virtual ~qt_touch_extension(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::qt_touch_extension *object); struct ::qt_touch_extension *object() { return m_qt_touch_extension; } const struct ::qt_touch_extension *object() const { return m_qt_touch_extension; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum flags { flags_mouse_from_touch = 0x1 }; void dummy(); protected: virtual void touch_extension_touch(uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, wl_array *rawdata); virtual void touch_extension_configure(uint32_t flags); private: void init_listener(); static const struct qt_touch_extension_listener m_qt_touch_extension_listener; static void handle_touch( void *data, struct ::qt_touch_extension *object, uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, wl_array *rawdata); static void handle_configure( void *data, struct ::qt_touch_extension *object, uint32_t flags); struct ::qt_touch_extension *m_qt_touch_extension; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwayland-wayland.h000066400000000000000000001057621476226662200327040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_WAYLAND #define QT_WAYLAND_WAYLAND #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_WAYLAND_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_registry { public: wl_registry(struct ::wl_registry *registry, int id, int version); wl_registry(struct ::wl_registry *object); wl_registry(); virtual ~wl_registry(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_registry *object); struct ::wl_registry *object() { return m_wl_registry; } const struct ::wl_registry *object() const { return m_wl_registry; } bool isInitialized() const; static const struct ::wl_interface *interface(); void *bind(uint32_t name, const struct ::wl_interface *interface, uint32_t version); protected: virtual void registry_global(uint32_t name, const QString &interface, uint32_t version); virtual void registry_global_remove(uint32_t name); private: void init_listener(); static const struct wl_registry_listener m_wl_registry_listener; static void handle_global( void *data, struct ::wl_registry *object, uint32_t name, const char *interface, uint32_t version); static void handle_global_remove( void *data, struct ::wl_registry *object, uint32_t name); struct ::wl_registry *m_wl_registry; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_callback { public: wl_callback(struct ::wl_registry *registry, int id, int version); wl_callback(struct ::wl_callback *object); wl_callback(); virtual ~wl_callback(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_callback *object); struct ::wl_callback *object() { return m_wl_callback; } const struct ::wl_callback *object() const { return m_wl_callback; } bool isInitialized() const; static const struct ::wl_interface *interface(); protected: virtual void callback_done(uint32_t callback_data); private: void init_listener(); static const struct wl_callback_listener m_wl_callback_listener; static void handle_done( void *data, struct ::wl_callback *object, uint32_t callback_data); struct ::wl_callback *m_wl_callback; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_compositor { public: wl_compositor(struct ::wl_registry *registry, int id, int version); wl_compositor(struct ::wl_compositor *object); wl_compositor(); virtual ~wl_compositor(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_compositor *object); struct ::wl_compositor *object() { return m_wl_compositor; } const struct ::wl_compositor *object() const { return m_wl_compositor; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_surface *create_surface(); struct ::wl_region *create_region(); private: struct ::wl_compositor *m_wl_compositor; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm_pool { public: wl_shm_pool(struct ::wl_registry *registry, int id, int version); wl_shm_pool(struct ::wl_shm_pool *object); wl_shm_pool(); virtual ~wl_shm_pool(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shm_pool *object); struct ::wl_shm_pool *object() { return m_wl_shm_pool; } const struct ::wl_shm_pool *object() const { return m_wl_shm_pool; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_buffer *create_buffer(int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format); void destroy(); void resize(int32_t size); private: struct ::wl_shm_pool *m_wl_shm_pool; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm { public: wl_shm(struct ::wl_registry *registry, int id, int version); wl_shm(struct ::wl_shm *object); wl_shm(); virtual ~wl_shm(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shm *object); struct ::wl_shm *object() { return m_wl_shm; } const struct ::wl_shm *object() const { return m_wl_shm; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_invalid_format = 0, // buffer format is not known error_invalid_stride = 1, // invalid size or stride during pool or buffer creation error_invalid_fd = 2 // mmapping the file descriptor failed }; enum format { format_argb8888 = 0, // 32-bit ARGB format format_xrgb8888 = 1, // 32-bit RGB format format_c8 = 0x20203843, format_rgb332 = 0x38424752, format_bgr233 = 0x38524742, format_xrgb4444 = 0x32315258, format_xbgr4444 = 0x32314258, format_rgbx4444 = 0x32315852, format_bgrx4444 = 0x32315842, format_argb4444 = 0x32315241, format_abgr4444 = 0x32314241, format_rgba4444 = 0x32314152, format_bgra4444 = 0x32314142, format_xrgb1555 = 0x35315258, format_xbgr1555 = 0x35314258, format_rgbx5551 = 0x35315852, format_bgrx5551 = 0x35315842, format_argb1555 = 0x35315241, format_abgr1555 = 0x35314241, format_rgba5551 = 0x35314152, format_bgra5551 = 0x35314142, format_rgb565 = 0x36314752, format_bgr565 = 0x36314742, format_rgb888 = 0x34324752, format_bgr888 = 0x34324742, format_xbgr8888 = 0x34324258, format_rgbx8888 = 0x34325852, format_bgrx8888 = 0x34325842, format_abgr8888 = 0x34324241, format_rgba8888 = 0x34324152, format_bgra8888 = 0x34324142, format_xrgb2101010 = 0x30335258, format_xbgr2101010 = 0x30334258, format_rgbx1010102 = 0x30335852, format_bgrx1010102 = 0x30335842, format_argb2101010 = 0x30335241, format_abgr2101010 = 0x30334241, format_rgba1010102 = 0x30334152, format_bgra1010102 = 0x30334142, format_yuyv = 0x56595559, format_yvyu = 0x55595659, format_uyvy = 0x59565955, format_vyuy = 0x59555956, format_ayuv = 0x56555941, format_nv12 = 0x3231564e, format_nv21 = 0x3132564e, format_nv16 = 0x3631564e, format_nv61 = 0x3136564e, format_yuv410 = 0x39565559, format_yvu410 = 0x39555659, format_yuv411 = 0x31315559, format_yvu411 = 0x31315659, format_yuv420 = 0x32315559, format_yvu420 = 0x32315659, format_yuv422 = 0x36315559, format_yvu422 = 0x36315659, format_yuv444 = 0x34325559, format_yvu444 = 0x34325659 }; struct ::wl_shm_pool *create_pool(int32_t fd, int32_t size); protected: virtual void shm_format(uint32_t format); private: void init_listener(); static const struct wl_shm_listener m_wl_shm_listener; static void handle_format( void *data, struct ::wl_shm *object, uint32_t format); struct ::wl_shm *m_wl_shm; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_buffer { public: wl_buffer(struct ::wl_registry *registry, int id, int version); wl_buffer(struct ::wl_buffer *object); wl_buffer(); virtual ~wl_buffer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_buffer *object); struct ::wl_buffer *object() { return m_wl_buffer; } const struct ::wl_buffer *object() const { return m_wl_buffer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); protected: virtual void buffer_release(); private: void init_listener(); static const struct wl_buffer_listener m_wl_buffer_listener; static void handle_release( void *data, struct ::wl_buffer *object); struct ::wl_buffer *m_wl_buffer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_offer { public: wl_data_offer(struct ::wl_registry *registry, int id, int version); wl_data_offer(struct ::wl_data_offer *object); wl_data_offer(); virtual ~wl_data_offer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_offer *object); struct ::wl_data_offer *object() { return m_wl_data_offer; } const struct ::wl_data_offer *object() const { return m_wl_data_offer; } bool isInitialized() const; static const struct ::wl_interface *interface(); void accept(uint32_t serial, const QString &mime_type); void receive(const QString &mime_type, int32_t fd); void destroy(); protected: virtual void data_offer_offer(const QString &mime_type); private: void init_listener(); static const struct wl_data_offer_listener m_wl_data_offer_listener; static void handle_offer( void *data, struct ::wl_data_offer *object, const char *mime_type); struct ::wl_data_offer *m_wl_data_offer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_source { public: wl_data_source(struct ::wl_registry *registry, int id, int version); wl_data_source(struct ::wl_data_source *object); wl_data_source(); virtual ~wl_data_source(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_source *object); struct ::wl_data_source *object() { return m_wl_data_source; } const struct ::wl_data_source *object() const { return m_wl_data_source; } bool isInitialized() const; static const struct ::wl_interface *interface(); void offer(const QString &mime_type); void destroy(); protected: virtual void data_source_target(const QString &mime_type); virtual void data_source_send(const QString &mime_type, int32_t fd); virtual void data_source_cancelled(); private: void init_listener(); static const struct wl_data_source_listener m_wl_data_source_listener; static void handle_target( void *data, struct ::wl_data_source *object, const char *mime_type); static void handle_send( void *data, struct ::wl_data_source *object, const char *mime_type, int32_t fd); static void handle_cancelled( void *data, struct ::wl_data_source *object); struct ::wl_data_source *m_wl_data_source; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device { public: wl_data_device(struct ::wl_registry *registry, int id, int version); wl_data_device(struct ::wl_data_device *object); wl_data_device(); virtual ~wl_data_device(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_device *object); struct ::wl_data_device *object() { return m_wl_data_device; } const struct ::wl_data_device *object() const { return m_wl_data_device; } bool isInitialized() const; static const struct ::wl_interface *interface(); void start_drag(struct ::wl_data_source *source, struct ::wl_surface *origin, struct ::wl_surface *icon, uint32_t serial); void set_selection(struct ::wl_data_source *source, uint32_t serial); protected: virtual void data_device_data_offer(struct ::wl_data_offer *id); virtual void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id); virtual void data_device_leave(); virtual void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y); virtual void data_device_drop(); virtual void data_device_selection(struct ::wl_data_offer *id); private: void init_listener(); static const struct wl_data_device_listener m_wl_data_device_listener; static void handle_data_offer( void *data, struct ::wl_data_device *object, struct ::wl_data_offer *id); static void handle_enter( void *data, struct ::wl_data_device *object, uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id); static void handle_leave( void *data, struct ::wl_data_device *object); static void handle_motion( void *data, struct ::wl_data_device *object, uint32_t time, wl_fixed_t x, wl_fixed_t y); static void handle_drop( void *data, struct ::wl_data_device *object); static void handle_selection( void *data, struct ::wl_data_device *object, struct ::wl_data_offer *id); struct ::wl_data_device *m_wl_data_device; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device_manager { public: wl_data_device_manager(struct ::wl_registry *registry, int id, int version); wl_data_device_manager(struct ::wl_data_device_manager *object); wl_data_device_manager(); virtual ~wl_data_device_manager(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_data_device_manager *object); struct ::wl_data_device_manager *object() { return m_wl_data_device_manager; } const struct ::wl_data_device_manager *object() const { return m_wl_data_device_manager; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_data_source *create_data_source(); struct ::wl_data_device *get_data_device(struct ::wl_seat *seat); private: struct ::wl_data_device_manager *m_wl_data_device_manager; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell { public: wl_shell(struct ::wl_registry *registry, int id, int version); wl_shell(struct ::wl_shell *object); wl_shell(); virtual ~wl_shell(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shell *object); struct ::wl_shell *object() { return m_wl_shell; } const struct ::wl_shell *object() const { return m_wl_shell; } bool isInitialized() const; static const struct ::wl_interface *interface(); struct ::wl_shell_surface *get_shell_surface(struct ::wl_surface *surface); private: struct ::wl_shell *m_wl_shell; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell_surface { public: wl_shell_surface(struct ::wl_registry *registry, int id, int version); wl_shell_surface(struct ::wl_shell_surface *object); wl_shell_surface(); virtual ~wl_shell_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_shell_surface *object); struct ::wl_shell_surface *object() { return m_wl_shell_surface; } const struct ::wl_shell_surface *object() const { return m_wl_shell_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum resize { resize_none = 0, resize_top = 1, resize_bottom = 2, resize_left = 4, resize_top_left = 5, resize_bottom_left = 6, resize_right = 8, resize_top_right = 9, resize_bottom_right = 10 }; enum transient { transient_inactive = 0x1 // do not set keyboard focus }; enum fullscreen_method { fullscreen_method_default = 0, // no preference, apply default policy fullscreen_method_scale = 1, // scale, preserve the surface's aspect ratio and center on output fullscreen_method_driver = 2, // switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch fullscreen_method_fill = 3 // no upscaling, center on output and add black borders to compensate size mismatch }; void pong(uint32_t serial); void move(struct ::wl_seat *seat, uint32_t serial); void resize(struct ::wl_seat *seat, uint32_t serial, uint32_t edges); void set_toplevel(); void set_transient(struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags); void set_fullscreen(uint32_t method, uint32_t framerate, struct ::wl_output *output); void set_popup(struct ::wl_seat *seat, uint32_t serial, struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags); void set_maximized(struct ::wl_output *output); void set_title(const QString &title); void set_class(const QString &class_); protected: virtual void shell_surface_ping(uint32_t serial); virtual void shell_surface_configure(uint32_t edges, int32_t width, int32_t height); virtual void shell_surface_popup_done(); private: void init_listener(); static const struct wl_shell_surface_listener m_wl_shell_surface_listener; static void handle_ping( void *data, struct ::wl_shell_surface *object, uint32_t serial); static void handle_configure( void *data, struct ::wl_shell_surface *object, uint32_t edges, int32_t width, int32_t height); static void handle_popup_done( void *data, struct ::wl_shell_surface *object); struct ::wl_shell_surface *m_wl_shell_surface; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_surface { public: wl_surface(struct ::wl_registry *registry, int id, int version); wl_surface(struct ::wl_surface *object); wl_surface(); virtual ~wl_surface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_surface *object); struct ::wl_surface *object() { return m_wl_surface; } const struct ::wl_surface *object() const { return m_wl_surface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_invalid_scale = 0, // buffer scale value is invalid error_invalid_transform = 1 // buffer transform value is invalid }; void destroy(); void attach(struct ::wl_buffer *buffer, int32_t x, int32_t y); void damage(int32_t x, int32_t y, int32_t width, int32_t height); struct ::wl_callback *frame(); void set_opaque_region(struct ::wl_region *region); void set_input_region(struct ::wl_region *region); void commit(); void set_buffer_transform(int32_t transform); void set_buffer_scale(int32_t scale); protected: virtual void surface_enter(struct ::wl_output *output); virtual void surface_leave(struct ::wl_output *output); private: void init_listener(); static const struct wl_surface_listener m_wl_surface_listener; static void handle_enter( void *data, struct ::wl_surface *object, struct ::wl_output *output); static void handle_leave( void *data, struct ::wl_surface *object, struct ::wl_output *output); struct ::wl_surface *m_wl_surface; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_seat { public: wl_seat(struct ::wl_registry *registry, int id, int version); wl_seat(struct ::wl_seat *object); wl_seat(); virtual ~wl_seat(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_seat *object); struct ::wl_seat *object() { return m_wl_seat; } const struct ::wl_seat *object() const { return m_wl_seat; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum capability { capability_pointer = 1, // The seat has pointer devices capability_keyboard = 2, // The seat has one or more keyboards capability_touch = 4 // The seat has touch devices }; struct ::wl_pointer *get_pointer(); struct ::wl_keyboard *get_keyboard(); struct ::wl_touch *get_touch(); protected: virtual void seat_capabilities(uint32_t capabilities); virtual void seat_name(const QString &name); private: void init_listener(); static const struct wl_seat_listener m_wl_seat_listener; static void handle_capabilities( void *data, struct ::wl_seat *object, uint32_t capabilities); static void handle_name( void *data, struct ::wl_seat *object, const char *name); struct ::wl_seat *m_wl_seat; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_pointer { public: wl_pointer(struct ::wl_registry *registry, int id, int version); wl_pointer(struct ::wl_pointer *object); wl_pointer(); virtual ~wl_pointer(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_pointer *object); struct ::wl_pointer *object() { return m_wl_pointer; } const struct ::wl_pointer *object() const { return m_wl_pointer; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum button_state { button_state_released = 0, // The button is not pressed button_state_pressed = 1 // The button is pressed }; enum axis { axis_vertical_scroll = 0, axis_horizontal_scroll = 1 }; void set_cursor(uint32_t serial, struct ::wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y); void release(); protected: virtual void pointer_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); virtual void pointer_leave(uint32_t serial, struct ::wl_surface *surface); virtual void pointer_motion(uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); virtual void pointer_button(uint32_t serial, uint32_t time, uint32_t button, uint32_t state); virtual void pointer_axis(uint32_t time, uint32_t axis, wl_fixed_t value); private: void init_listener(); static const struct wl_pointer_listener m_wl_pointer_listener; static void handle_enter( void *data, struct ::wl_pointer *object, uint32_t serial, struct ::wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); static void handle_leave( void *data, struct ::wl_pointer *object, uint32_t serial, struct ::wl_surface *surface); static void handle_motion( void *data, struct ::wl_pointer *object, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); static void handle_button( void *data, struct ::wl_pointer *object, uint32_t serial, uint32_t time, uint32_t button, uint32_t state); static void handle_axis( void *data, struct ::wl_pointer *object, uint32_t time, uint32_t axis, wl_fixed_t value); struct ::wl_pointer *m_wl_pointer; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_keyboard { public: wl_keyboard(struct ::wl_registry *registry, int id, int version); wl_keyboard(struct ::wl_keyboard *object); wl_keyboard(); virtual ~wl_keyboard(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_keyboard *object); struct ::wl_keyboard *object() { return m_wl_keyboard; } const struct ::wl_keyboard *object() const { return m_wl_keyboard; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum keymap_format { keymap_format_no_keymap = 0, // no keymap; client must understand how to interpret the raw keycode keymap_format_xkb_v1 = 1 // libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode }; enum key_state { key_state_released = 0, // key is not pressed key_state_pressed = 1 // key is pressed }; void release(); protected: virtual void keyboard_keymap(uint32_t format, int32_t fd, uint32_t size); virtual void keyboard_enter(uint32_t serial, struct ::wl_surface *surface, wl_array *keys); virtual void keyboard_leave(uint32_t serial, struct ::wl_surface *surface); virtual void keyboard_key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state); virtual void keyboard_modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); virtual void keyboard_repeat_info(int32_t rate, int32_t delay); private: void init_listener(); static const struct wl_keyboard_listener m_wl_keyboard_listener; static void handle_keymap( void *data, struct ::wl_keyboard *object, uint32_t format, int32_t fd, uint32_t size); static void handle_enter( void *data, struct ::wl_keyboard *object, uint32_t serial, struct ::wl_surface *surface, wl_array *keys); static void handle_leave( void *data, struct ::wl_keyboard *object, uint32_t serial, struct ::wl_surface *surface); static void handle_key( void *data, struct ::wl_keyboard *object, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); static void handle_modifiers( void *data, struct ::wl_keyboard *object, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); static void handle_repeat_info( void *data, struct ::wl_keyboard *object, int32_t rate, int32_t delay); struct ::wl_keyboard *m_wl_keyboard; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_touch { public: wl_touch(struct ::wl_registry *registry, int id, int version); wl_touch(struct ::wl_touch *object); wl_touch(); virtual ~wl_touch(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_touch *object); struct ::wl_touch *object() { return m_wl_touch; } const struct ::wl_touch *object() const { return m_wl_touch; } bool isInitialized() const; static const struct ::wl_interface *interface(); void release(); protected: virtual void touch_down(uint32_t serial, uint32_t time, struct ::wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); virtual void touch_up(uint32_t serial, uint32_t time, int32_t id); virtual void touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); virtual void touch_frame(); virtual void touch_cancel(); private: void init_listener(); static const struct wl_touch_listener m_wl_touch_listener; static void handle_down( void *data, struct ::wl_touch *object, uint32_t serial, uint32_t time, struct ::wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); static void handle_up( void *data, struct ::wl_touch *object, uint32_t serial, uint32_t time, int32_t id); static void handle_motion( void *data, struct ::wl_touch *object, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); static void handle_frame( void *data, struct ::wl_touch *object); static void handle_cancel( void *data, struct ::wl_touch *object); struct ::wl_touch *m_wl_touch; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_output { public: wl_output(struct ::wl_registry *registry, int id, int version); wl_output(struct ::wl_output *object); wl_output(); virtual ~wl_output(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_output *object); struct ::wl_output *object() { return m_wl_output; } const struct ::wl_output *object() const { return m_wl_output; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum subpixel { subpixel_unknown = 0, subpixel_none = 1, subpixel_horizontal_rgb = 2, subpixel_horizontal_bgr = 3, subpixel_vertical_rgb = 4, subpixel_vertical_bgr = 5 }; enum transform { transform_normal = 0, transform_90 = 1, transform_180 = 2, transform_270 = 3, transform_flipped = 4, transform_flipped_90 = 5, transform_flipped_180 = 6, transform_flipped_270 = 7 }; enum mode { mode_current = 0x1, // indicates this is the current mode mode_preferred = 0x2 // indicates this is the preferred mode }; protected: virtual void output_geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const QString &make, const QString &model, int32_t transform); virtual void output_mode(uint32_t flags, int32_t width, int32_t height, int32_t refresh); virtual void output_done(); virtual void output_scale(int32_t factor); private: void init_listener(); static const struct wl_output_listener m_wl_output_listener; static void handle_geometry( void *data, struct ::wl_output *object, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform); static void handle_mode( void *data, struct ::wl_output *object, uint32_t flags, int32_t width, int32_t height, int32_t refresh); static void handle_done( void *data, struct ::wl_output *object); static void handle_scale( void *data, struct ::wl_output *object, int32_t factor); struct ::wl_output *m_wl_output; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_region { public: wl_region(struct ::wl_registry *registry, int id, int version); wl_region(struct ::wl_region *object); wl_region(); virtual ~wl_region(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_region *object); struct ::wl_region *object() { return m_wl_region; } const struct ::wl_region *object() const { return m_wl_region; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); void add(int32_t x, int32_t y, int32_t width, int32_t height); void subtract(int32_t x, int32_t y, int32_t width, int32_t height); private: struct ::wl_region *m_wl_region; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subcompositor { public: wl_subcompositor(struct ::wl_registry *registry, int id, int version); wl_subcompositor(struct ::wl_subcompositor *object); wl_subcompositor(); virtual ~wl_subcompositor(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_subcompositor *object); struct ::wl_subcompositor *object() { return m_wl_subcompositor; } const struct ::wl_subcompositor *object() const { return m_wl_subcompositor; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_bad_surface = 0 // the to-be sub-surface is invalid }; void destroy(); struct ::wl_subsurface *get_subsurface(struct ::wl_surface *surface, struct ::wl_surface *parent); private: struct ::wl_subcompositor *m_wl_subcompositor; }; class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subsurface { public: wl_subsurface(struct ::wl_registry *registry, int id, int version); wl_subsurface(struct ::wl_subsurface *object); wl_subsurface(); virtual ~wl_subsurface(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::wl_subsurface *object); struct ::wl_subsurface *object() { return m_wl_subsurface; } const struct ::wl_subsurface *object() const { return m_wl_subsurface; } bool isInitialized() const; static const struct ::wl_interface *interface(); enum error { error_bad_surface = 0 // wl_surface is not a sibling or the parent }; void destroy(); void set_position(int32_t x, int32_t y); void place_above(struct ::wl_surface *sibling); void place_below(struct ::wl_surface *sibling); void set_sync(); void set_desync(); private: struct ::wl_subsurface *m_wl_subsurface; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwayland-xdg-output-unstable-v1.h000066400000000000000000000070241476226662200354350ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_WAYLAND_XDG_OUTPUT_UNSTABLE_V1 #define QT_WAYLAND_XDG_OUTPUT_UNSTABLE_V1 #include #include #include QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") #if !defined(Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT) # if defined(QT_SHARED) # define Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT Q_DECL_EXPORT # else # define Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT # endif #endif namespace QtWayland { class Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT zxdg_output_manager_v1 { public: zxdg_output_manager_v1(struct ::wl_registry *registry, int id, int version); zxdg_output_manager_v1(struct ::zxdg_output_manager_v1 *object); zxdg_output_manager_v1(); virtual ~zxdg_output_manager_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zxdg_output_manager_v1 *object); struct ::zxdg_output_manager_v1 *object() { return m_zxdg_output_manager_v1; } const struct ::zxdg_output_manager_v1 *object() const { return m_zxdg_output_manager_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); struct ::zxdg_output_v1 *get_xdg_output(struct ::wl_output *output); private: struct ::zxdg_output_manager_v1 *m_zxdg_output_manager_v1; }; class Q_WAYLAND_CLIENT_XDG_OUTPUT_UNSTABLE_V1_EXPORT zxdg_output_v1 { public: zxdg_output_v1(struct ::wl_registry *registry, int id, int version); zxdg_output_v1(struct ::zxdg_output_v1 *object); zxdg_output_v1(); virtual ~zxdg_output_v1(); void init(struct ::wl_registry *registry, int id, int version); void init(struct ::zxdg_output_v1 *object); struct ::zxdg_output_v1 *object() { return m_zxdg_output_v1; } const struct ::zxdg_output_v1 *object() const { return m_zxdg_output_v1; } bool isInitialized() const; static const struct ::wl_interface *interface(); void destroy(); protected: virtual void zxdg_output_v1_logical_position(int32_t x, int32_t y); virtual void zxdg_output_v1_logical_size(int32_t width, int32_t height); virtual void zxdg_output_v1_done(); virtual void zxdg_output_v1_name(const QString &name); virtual void zxdg_output_v1_description(const QString &description); private: void init_listener(); static const struct zxdg_output_v1_listener m_zxdg_output_v1_listener; static void handle_logical_position( void *data, struct ::zxdg_output_v1 *object, int32_t x, int32_t y); static void handle_logical_size( void *data, struct ::zxdg_output_v1 *object, int32_t width, int32_t height); static void handle_done( void *data, struct ::zxdg_output_v1 *object); static void handle_name( void *data, struct ::zxdg_output_v1 *object, const char *name); static void handle_description( void *data, struct ::zxdg_output_v1 *object, const char *description); struct ::zxdg_output_v1 *m_zxdg_output_v1; }; } QT_WARNING_POP QT_END_NAMESPACE #endif qwaylandabstractdecoration_p.h000066400000000000000000000044271476226662200352770ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2017 Robin Burchell // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDABSTRACTDECORATION_H #define QWAYLANDABSTRACTDECORATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE class QWindow; class QPaintDevice; class QPainter; class QEvent; namespace QtWaylandClient { class QWaylandScreen; class QWaylandWindow; class QWaylandInputDevice; class QWaylandAbstractDecorationPrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandAbstractDecoration) public: QWaylandAbstractDecoration(); ~QWaylandAbstractDecoration() override; void setWaylandWindow(QWaylandWindow *window); QWaylandWindow *waylandWindow() const; void update(); bool isDirty() const; virtual QMargins margins() const = 0; QWindow *window() const; const QImage &contentImage(); virtual bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) = 0; virtual bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) = 0; protected: virtual void paint(QPaintDevice *device) = 0; void setMouseButtons(Qt::MouseButtons mb); void startResize(QWaylandInputDevice *inputDevice,enum wl_shell_surface_resize resize, Qt::MouseButtons buttons); void startMove(QWaylandInputDevice *inputDevice, Qt::MouseButtons buttons); bool isLeftClicked(Qt::MouseButtons newMouseButtonState); bool isLeftReleased(Qt::MouseButtons newMouseButtonState); }; } QT_END_NAMESPACE #endif // QWAYLANDABSTRACTDECORATION_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandbuffer_p.h000066400000000000000000000024701476226662200327500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDBUFFER_H #define QWAYLANDBUFFER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer { public: QWaylandBuffer(); virtual ~QWaylandBuffer(); void init(wl_buffer *buf); wl_buffer *buffer() {return mBuffer;} virtual QSize size() const = 0; virtual int scale() const { return 1; } void setBusy() { mBusy = true; } bool busy() const { return mBusy; } void setCommitted() { mCommitted = true; } bool committed() const { return mCommitted; } protected: struct wl_buffer *mBuffer = nullptr; private: bool mBusy = false; bool mCommitted = false; static void release(void *data, wl_buffer *); static const wl_buffer_listener listener; }; } QT_END_NAMESPACE #endif // QWAYLANDBUFFER_H qwaylandclientbufferintegration_p.h000066400000000000000000000032141476226662200363310ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H #define QWAYLANDCLIENTBUFFERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE class QWindow; class QPlatformOpenGLContext; class QSurfaceFormat; namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegration { public: QWaylandClientBufferIntegration(); virtual ~QWaylandClientBufferIntegration(); virtual void initialize(QWaylandDisplay *display) = 0; virtual bool isValid() const { return true; } virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsWindowDecoration() const { return false; } virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; enum NativeResource { EglDisplay, EglConfig, EglContext }; virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; } virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATION_H qwaylandclientbufferintegrationfactory_p.h000066400000000000000000000017441476226662200377270ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H #define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandClientBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H qwaylandclientbufferintegrationplugin_p.h000066400000000000000000000023651476226662200375560ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandClientBufferIntegration; #define QWaylandClientBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandClientBufferIntegrationPlugin() override; virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H qwaylandclientextension.h000066400000000000000000000045161476226662200343170ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2017 Erik Larsson. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTEXTENSION_H #define QWAYLANDCLIENTEXTENSION_H #include #include struct wl_interface; struct wl_registry; QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandIntegration; } class QWaylandClientExtensionPrivate; class QWaylandClientExtensionTemplatePrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtension : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandClientExtension) Q_PROPERTY(int protocolVersion READ version NOTIFY versionChanged) Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) public: QWaylandClientExtension(const int version); QtWaylandClient::QWaylandIntegration *integration() const; int version() const; bool isActive() const; virtual const struct wl_interface *extensionInterface() const = 0; virtual void bind(struct ::wl_registry *registry, int id, int version) = 0; protected: void setVersion(const int version); Q_SIGNALS: void versionChanged(); void activeChanged(); private Q_SLOTS: void addRegistryListener(); }; template class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplate : public QWaylandClientExtension { Q_DECLARE_PRIVATE(QWaylandClientExtensionTemplate) public: QWaylandClientExtensionTemplate(const int ver) : QWaylandClientExtension(ver) { } const struct wl_interface *extensionInterface() const override { return T::interface(); } void bind(struct ::wl_registry *registry, int id, int ver) override { T* instance = static_cast(this); // Make sure lowest version is used of the supplied version from the // developer and the version specified in the protocol and also the // compositor version. if (this->version() > T::interface()->version) { qWarning("Supplied protocol version to QWaylandClientExtensionTemplate is higher than the version of the protocol, using protocol version instead."); } int minVersion = qMin(ver, qMin(T::interface()->version, this->version())); setVersion(minVersion); instance->init(registry, id, minVersion); } }; QT_END_NAMESPACE #endif // QWAYLANDCLIENTEXTENSION_H qwaylandclientextension_p.h000066400000000000000000000024341476226662200346330ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2017 Erik Larsson. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIENTEXTENSION_P_H #define QWAYLANDCLIENTEXTENSION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QWaylandClientExtension) public: QWaylandClientExtensionPrivate(); static void handleRegistryGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); QtWaylandClient::QWaylandIntegration *waylandIntegration = nullptr; int version = -1; bool active = false; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate { public: QWaylandClientExtensionTemplatePrivate() { } }; QT_END_NAMESPACE #endif /*QWAYLANDCLIENTEXTENSION_P_H*/ qwaylandclipboard_p.h000066400000000000000000000023661476226662200333630ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCLIPBOARD_H #define QWAYLANDCLIPBOARD_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_REQUIRE_CONFIG(clipboard); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandClipboard : public QPlatformClipboard { public: QWaylandClipboard(QWaylandDisplay *display); ~QWaylandClipboard() override; QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; private: QWaylandDisplay *mDisplay = nullptr; QMimeData m_emptyData; }; } QT_END_NAMESPACE #endif // QWAYLANDCLIPBOARD_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandcursor_p.h000066400000000000000000000054721476226662200330210ustar00rootroot00000000000000// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDCURSOR_H #define QWAYLANDCURSOR_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #if QT_CONFIG(cursor) struct wl_cursor; struct wl_cursor_image; struct wl_cursor_theme; QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandBuffer; class QWaylandDisplay; class QWaylandScreen; class QWaylandShm; class Q_WAYLAND_CLIENT_EXPORT QWaylandCursorTheme { public: static QWaylandCursorTheme *create(QWaylandShm *shm, int size); static QWaylandCursorTheme *create(QWaylandShm *shm, int size, const QString &themeName); ~QWaylandCursorTheme(); struct wl_cursor_image *cursorImage(Qt::CursorShape shape); private: enum WaylandCursor { ArrowCursor = Qt::ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IBeamCursor, SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor, PointingHandCursor, ForbiddenCursor, WhatsThisCursor, BusyCursor, OpenHandCursor, ClosedHandCursor, DragCopyCursor, DragMoveCursor, DragLinkCursor, // The following are used for cursors that don't have equivalents in Qt ResizeNorthCursor = Qt::CustomCursor + 1, ResizeSouthCursor, ResizeEastCursor, ResizeWestCursor, ResizeNorthWestCursor, ResizeSouthEastCursor, ResizeNorthEastCursor, ResizeSouthWestCursor }; explicit QWaylandCursorTheme(struct ::wl_cursor_theme *theme) : m_theme(theme) {} struct ::wl_cursor *requestCursor(WaylandCursor shape); struct ::wl_cursor_theme *m_theme = nullptr; QMap m_cursors; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandCursor : public QPlatformCursor { public: QWaylandCursor(QWaylandScreen *screen); void changeCursor(QCursor *cursor, QWindow *window) override; void pointerEvent(const QMouseEvent &event) override; QPoint pos() const override; void setPos(const QPoint &pos) override; QSharedPointer cursorBitmapImage(const QCursor *cursor); struct wl_cursor_image *cursorImage(Qt::CursorShape shape); private: QWaylandDisplay *mDisplay = nullptr; QWaylandCursorTheme *mCursorTheme = nullptr; QPoint mLastPos; }; } QT_END_NAMESPACE #endif // cursor #endif // QWAYLANDCURSOR_H qwaylanddatadevice_p.h000066400000000000000000000052041476226662200335070ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Klarälvdalens Datakonsult AB (KDAB). // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATADEVICE_H #define QWAYLANDDATADEVICE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE class QMimeData; class QWindow; namespace QtWaylandClient { class QWaylandDisplay; class QWaylandDataDeviceManager; class QWaylandDataOffer; class QWaylandDataSource; class QWaylandInputDevice; class QWaylandWindow; class QWaylandDataDevice : public QObject, public QtWayland::wl_data_device { Q_OBJECT public: QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWaylandInputDevice *inputDevice); ~QWaylandDataDevice() override; QWaylandDataOffer *selectionOffer() const; void invalidateSelectionOffer(); QWaylandDataSource *selectionSource() const; void setSelectionSource(QWaylandDataSource *source); #if QT_CONFIG(draganddrop) QWaylandDataOffer *dragOffer() const; void startDrag(QMimeData *mimeData, QWaylandWindow *icon); void cancelDrag(); #endif protected: void data_device_data_offer(struct ::wl_data_offer *id) override; #if QT_CONFIG(draganddrop) void data_device_drop() override; void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id) override; void data_device_leave() override; void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y) override; #endif void data_device_selection(struct ::wl_data_offer *id) override; private Q_SLOTS: void selectionSourceCancelled(); #if QT_CONFIG(draganddrop) void dragSourceCancelled(); void dragSourceTargetChanged(const QString &mimeType); #endif private: #if QT_CONFIG(draganddrop) QPoint calculateDragPosition(int x, int y, QWindow *wnd) const; #endif QWaylandDisplay *m_display = nullptr; QWaylandInputDevice *m_inputDevice = nullptr; uint32_t m_enterSerial = 0; QPointer m_dragWindow; QPoint m_dragPoint; QScopedPointer m_dragOffer; QScopedPointer m_selectionOffer; QScopedPointer m_selectionSource; QScopedPointer m_dragSource; }; } QT_END_NAMESPACE #endif // QWAYLANDDATADEVICE_H qwaylanddatadevicemanager_p.h000066400000000000000000000022541476226662200350440ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATADEVICEMANAGER_H #define QWAYLANDDATADEVICEMANAGER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandDataDevice; class QWaylandDataSource; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataDeviceManager : public QtWayland::wl_data_device_manager { public: QWaylandDataDeviceManager(QWaylandDisplay *display, uint32_t id); ~QWaylandDataDeviceManager() override; QWaylandDataDevice *getDataDevice(QWaylandInputDevice *inputDevice); QWaylandDisplay *display() const; private: QWaylandDisplay *m_display = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDDATADEVICEMANAGER_H qwaylanddataoffer_p.h000066400000000000000000000034741476226662200333600ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATAOFFER_H #define QWAYLANDDATAOFFER_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandMimeData; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataOffer : public QtWayland::wl_data_offer { public: explicit QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer); ~QWaylandDataOffer() override; QString firstFormat() const; QMimeData *mimeData(); protected: void data_offer_offer(const QString &mime_type) override; private: QScopedPointer m_mimeData; }; class QWaylandMimeData : public QInternalMimeData { public: explicit QWaylandMimeData(QWaylandDataOffer *dataOffer, QWaylandDisplay *display); ~QWaylandMimeData() override; void appendFormat(const QString &mimeType); protected: bool hasFormat_sys(const QString &mimeType) const override; QStringList formats_sys() const override; QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const override; private: int readData(int fd, QByteArray &data) const; mutable QWaylandDataOffer *m_dataOffer = nullptr; QWaylandDisplay *m_display = nullptr; mutable QStringList m_types; mutable QHash m_data; }; } QT_END_NAMESPACE #endif qwaylanddatasource_p.h000066400000000000000000000026301476226662200335500ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDATASOURCE_H #define QWAYLANDDATASOURCE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_REQUIRE_CONFIG(wayland_datadevice); QT_BEGIN_NAMESPACE class QMimeData; namespace QtWaylandClient { class QWaylandDataDeviceManager; class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandDataSource : public QObject, public QtWayland::wl_data_source { Q_OBJECT public: QWaylandDataSource(QWaylandDataDeviceManager *dataDeviceManager, QMimeData *mimeData); ~QWaylandDataSource() override; QMimeData *mimeData() const; Q_SIGNALS: void targetChanged(const QString &mime_type); void cancelled(); protected: void data_source_cancelled() override; void data_source_send(const QString &mime_type, int32_t fd) override; void data_source_target(const QString &mime_type) override; private: QWaylandDisplay *m_display = nullptr; QMimeData *m_mime_data = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDDATASOURCE_H qwaylanddecorationfactory_p.h000066400000000000000000000016771476226662200351470ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Robin Burchell // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDECORATIONFACTORY_H #define QWAYLANDDECORATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandAbstractDecoration; class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDDECORATIONFACTORY_H qwaylanddecorationplugin_p.h000066400000000000000000000022341476226662200347640ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Robin Burchell // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDECORATIONPLUGIN_H #define QWAYLANDDECORATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandAbstractDecoration; #define QWaylandDecorationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandDecorationFactoryInterface.5.4" class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject { Q_OBJECT public: explicit QWaylandDecorationPlugin(QObject *parent = nullptr); ~QWaylandDecorationPlugin() override; virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDDECORATIONPLUGIN_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylanddisplay_p.h000066400000000000000000000171631476226662200331510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDISPLAY_H #define QWAYLANDDISPLAY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include struct wl_cursor_image; QT_BEGIN_NAMESPACE class QAbstractEventDispatcher; class QSocketNotifier; class QPlatformScreen; namespace QtWayland { class qt_surface_extension; class zwp_text_input_manager_v2; class zxdg_output_manager_v1; } namespace QtWaylandClient { Q_WAYLAND_CLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaWayland); class QWaylandInputDevice; class QWaylandBuffer; class QWaylandScreen; class QWaylandClientBufferIntegration; class QWaylandWindowManagerIntegration; class QWaylandDataDeviceManager; class QWaylandTouchExtension; class QWaylandQtKeyExtension; class QWaylandWindow; class QWaylandIntegration; class QWaylandHardwareIntegration; class QWaylandShellSurface; class QWaylandCursorTheme; typedef void (*RegistryListener)(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); class Q_WAYLAND_CLIENT_EXPORT QWaylandDisplay : public QObject, public QtWayland::wl_registry { Q_OBJECT public: QWaylandDisplay(QWaylandIntegration *waylandIntegration); ~QWaylandDisplay(void) override; QList screens() const { return mScreens; } QWaylandScreen *screenForOutput(struct wl_output *output) const; struct wl_surface *createSurface(void *handle); QWaylandShellSurface *createShellSurface(QWaylandWindow *window); struct ::wl_region *createRegion(const QRegion &qregion); struct ::wl_subsurface *createSubSurface(QWaylandWindow *window, QWaylandWindow *parent); QWaylandClientBufferIntegration *clientBufferIntegration() const; QWaylandWindowManagerIntegration *windowManagerIntegration() const; #if QT_CONFIG(cursor) void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image, qreal dpr); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot, qreal dpr); QWaylandCursorTheme *loadCursorTheme(qreal devicePixelRatio); #endif struct wl_display *wl_display() const { return mDisplay; } struct ::wl_registry *wl_registry() { return object(); } const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } QtWayland::wl_compositor *compositor() { return &mCompositor; } int compositorVersion() const { return mCompositorVersion; } QList inputDevices() const { return mInputDevices; } QWaylandInputDevice *defaultInputDevice() const; QWaylandInputDevice *currentInputDevice() const { return defaultInputDevice(); } #if QT_CONFIG(wayland_datadevice) QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); } #endif QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); } QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } QtWayland::zxdg_output_manager_v1 *xdgOutputManager() const { return mXdgOutputManager.data(); } struct RegistryGlobal { uint32_t id; QString interface; uint32_t version; struct ::wl_registry *registry = nullptr; RegistryGlobal(uint32_t id_, const QString &interface_, uint32_t version_, struct ::wl_registry *registry_) : id(id_), interface(interface_), version(version_), registry(registry_) { } }; QList globals() const { return mGlobals; } bool hasRegistryGlobal(const QString &interfaceName); /* wl_registry_add_listener does not add but rather sets a listener, so this function is used * to enable many listeners at once. */ void addRegistryListener(RegistryListener listener, void *data); QWaylandShm *shm() const { return mShm.data(); } static uint32_t currentTimeMillisec(); void forceRoundTrip(); bool supportsWindowDecoration() const; uint32_t lastInputSerial() const { return mLastInputSerial; } QWaylandInputDevice *lastInputDevice() const { return mLastInputDevice; } QWaylandWindow *lastInputWindow() const; void setLastInputDevice(QWaylandInputDevice *device, uint32_t serial, QWaylandWindow *window); void handleWindowActivated(QWaylandWindow *window); void handleWindowDeactivated(QWaylandWindow *window); void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); void handleWindowDestroyed(QWaylandWindow *window); public slots: void blockingReadEvents(); void flushRequests(); private: void waitForScreens(); void exitWithError(); void checkError() const; void handleWaylandSync(); void requestWaylandSync(); struct Listener { RegistryListener listener = nullptr; void *data = nullptr; }; struct wl_display *mDisplay = nullptr; QtWayland::wl_compositor mCompositor; QScopedPointer mShm; QList mScreens; QList mInputDevices; QList mRegistryListeners; QWaylandIntegration *mWaylandIntegration = nullptr; #if QT_CONFIG(cursor) QMap mCursorThemesBySize; #endif #if QT_CONFIG(wayland_datadevice) QScopedPointer mDndSelectionHandler; #endif QScopedPointer mWindowExtension; QScopedPointer mSubCompositor; QScopedPointer mTouchExtension; QScopedPointer mQtKeyExtension; QScopedPointer mWindowManagerIntegration; QScopedPointer mTextInputManager; QScopedPointer mHardwareIntegration; QScopedPointer mXdgOutputManager; QSocketNotifier *mReadNotifier = nullptr; int mFd; int mWritableNotificationFd; QList mGlobals; int mCompositorVersion; uint32_t mLastInputSerial = 0; QWaylandInputDevice *mLastInputDevice = nullptr; QPointer mLastInputWindow; QPointer mLastKeyboardFocus; QVector mActiveWindows; struct wl_callback *mSyncCallback = nullptr; static const wl_callback_listener syncCallbackListener; void registry_global(uint32_t id, const QString &interface, uint32_t version) override; void registry_global_remove(uint32_t id) override; static void shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, int32_t width, int32_t height); }; } QT_END_NAMESPACE #endif // QWAYLANDDISPLAY_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylanddnd_p.h000066400000000000000000000024421476226662200322430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDDND_H #define QWAYLANDDND_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; #if QT_CONFIG(draganddrop) class Q_WAYLAND_CLIENT_EXPORT QWaylandDrag : public QBasicDrag { public: QWaylandDrag(QWaylandDisplay *display); ~QWaylandDrag() override; void updateTarget(const QString &mimeType); void setResponse(const QPlatformDragQtResponse &response); void finishDrag(const QPlatformDropQtResponse &response); protected: void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; private: QWaylandDisplay *m_display = nullptr; }; #endif } QT_END_NAMESPACE #endif // QWAYLANDDND_H qwaylandextendedsurface_p.h000066400000000000000000000027171476226662200345750ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDEXTENDEDSURFACE_H #define QWAYLANDEXTENDEDSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface { public: QWaylandExtendedSurface(QWaylandWindow *window); ~QWaylandExtendedSurface() override; void setContentOrientationMask(Qt::ScreenOrientations mask); void updateGenericProperty(const QString &name, const QVariant &value); Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); private: void extended_surface_onscreen_visibility(int32_t visibility) override; void extended_surface_set_generic_property(const QString &name, wl_array *value) override; void extended_surface_close() override; QWaylandWindow *m_window = nullptr; QVariantMap m_properties; }; } QT_END_NAMESPACE #endif // QWAYLANDEXTENDEDSURFACE_H qwaylandhardwareintegration_p.h000066400000000000000000000022131476226662200354540ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDHARDWAREINTEGRATION_H #define QWAYLANDHARDWAREINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandHardwareIntegration : public QtWayland::qt_hardware_integration { public: QWaylandHardwareIntegration(struct ::wl_registry *registry, int id); QString clientBufferIntegration(); QString serverBufferIntegration(); protected: void hardware_integration_client_backend(const QString &name) override; void hardware_integration_server_backend(const QString &name) override; private: QString m_client_buffer; QString m_server_buffer; }; } QT_END_NAMESPACE #endif qwaylandinputcontext_p.h000066400000000000000000000101241476226662200341570ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTCONTEXT_H #define QWAYLANDINPUTCONTEXT_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(qLcQpaInputMethods) namespace QtWaylandClient { class QWaylandDisplay; class QWaylandTextInput : public QtWayland::zwp_text_input_v2 { public: QWaylandTextInput(QWaylandDisplay *display, struct ::zwp_text_input_v2 *text_input); ~QWaylandTextInput() override; void reset(); void commit(); void updateState(Qt::InputMethodQueries queries, uint32_t flags); void setCursorInsidePreedit(int cursor); bool isInputPanelVisible() const; QRectF keyboardRect() const; QLocale locale() const; Qt::LayoutDirection inputDirection() const; protected: void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface) override; void zwp_text_input_v2_leave(uint32_t serial, struct ::wl_surface *surface) override; void zwp_text_input_v2_modifiers_map(wl_array *map) override; void zwp_text_input_v2_input_panel_state(uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height) override; void zwp_text_input_v2_preedit_string(const QString &text, const QString &commit) override; void zwp_text_input_v2_preedit_styling(uint32_t index, uint32_t length, uint32_t style) override; void zwp_text_input_v2_preedit_cursor(int32_t index) override; void zwp_text_input_v2_commit_string(const QString &text) override; void zwp_text_input_v2_cursor_position(int32_t index, int32_t anchor) override; void zwp_text_input_v2_delete_surrounding_text(uint32_t before_length, uint32_t after_length) override; void zwp_text_input_v2_keysym(uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) override; void zwp_text_input_v2_language(const QString &language) override; void zwp_text_input_v2_text_direction(uint32_t direction) override; void zwp_text_input_v2_input_method_changed(uint32_t serial, uint32_t flags) override; private: Qt::KeyboardModifiers modifiersToQtModifiers(uint32_t modifiers); QWaylandDisplay *m_display = nullptr; QWaylandInputMethodEventBuilder m_builder; QVector m_modifiersMap; uint32_t m_serial = 0; struct ::wl_surface *m_surface = nullptr; QString m_preeditCommit; bool m_inputPanelVisible = false; QRectF m_keyboardRectangle; QLocale m_locale; Qt::LayoutDirection m_inputDirection = Qt::LayoutDirectionAuto; struct ::wl_callback *m_resetCallback = nullptr; static const wl_callback_listener callbackListener; static void resetCallback(void *data, struct wl_callback *wl_callback, uint32_t time); }; class QWaylandInputContext : public QPlatformInputContext { Q_OBJECT public: explicit QWaylandInputContext(QWaylandDisplay *display); ~QWaylandInputContext() override; bool isValid() const override; void reset() override; void commit() override; void update(Qt::InputMethodQueries) override; void invokeAction(QInputMethod::Action, int cursorPosition) override; void showInputPanel() override; void hideInputPanel() override; bool isInputPanelVisible() const override; QRectF keyboardRect() const override; QLocale locale() const override; Qt::LayoutDirection inputDirection() const override; void setFocusObject(QObject *object) override; private: QWaylandTextInput *textInput() const; QWaylandDisplay *mDisplay = nullptr; QPointer mCurrentWindow; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTCONTEXT_H qwaylandinputdevice_p.h000066400000000000000000000207531476226662200337430ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICE_H #define QWAYLANDINPUTDEVICE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include #if QT_CONFIG(xkbcommon_evdev) #include #include #endif #include #include #if QT_CONFIG(cursor) struct wl_cursor_image; #endif #if QT_CONFIG(xkbcommon_evdev) struct xkb_compose_state; struct xkb_compose_table; #endif QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandDataDevice; class QWaylandTextInput; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice : public QObject , public QtWayland::wl_seat { Q_OBJECT public: class Keyboard; class Pointer; class Touch; QWaylandInputDevice(QWaylandDisplay *display, int version, uint32_t id); ~QWaylandInputDevice() override; uint32_t capabilities() const { return mCaps; } struct ::wl_seat *wl_seat() { return QtWayland::wl_seat::object(); } #if QT_CONFIG(cursor) void setCursor(const QCursor &cursor, QWaylandScreen *screen); void setCursor(struct wl_buffer *buffer, struct ::wl_cursor_image *image, int bufferScale); void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size, int bufferScale); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot, int bufferScale); #endif void handleWindowDestroyed(QWaylandWindow *window); void handleEndDrag(); #if QT_CONFIG(wayland_datadevice) void setDataDevice(QWaylandDataDevice *device); QWaylandDataDevice *dataDevice() const; #endif void setTextInput(QWaylandTextInput *textInput); QWaylandTextInput *textInput() const; void removeMouseButtonFromState(Qt::MouseButton button); QWaylandWindow *pointerFocus() const; QWaylandWindow *keyboardFocus() const; QWaylandWindow *touchFocus() const; Qt::KeyboardModifiers modifiers() const; uint32_t serial() const; uint32_t cursorSerial() const; virtual Keyboard *createKeyboard(QWaylandInputDevice *device); virtual Pointer *createPointer(QWaylandInputDevice *device); virtual Touch *createTouch(QWaylandInputDevice *device); private: void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); QWaylandDisplay *mQDisplay = nullptr; struct wl_display *mDisplay = nullptr; int mVersion; uint32_t mCaps = 0; struct wl_surface *pointerSurface = nullptr; #if QT_CONFIG(wayland_datadevice) QWaylandDataDevice *mDataDevice = nullptr; #endif Keyboard *mKeyboard = nullptr; Pointer *mPointer = nullptr; Touch *mTouch = nullptr; QWaylandTextInput *mTextInput = nullptr; uint32_t mTime = 0; uint32_t mSerial = 0; void seat_capabilities(uint32_t caps) override; void handleTouchPoint(int id, double x, double y, Qt::TouchPointState state); QTouchDevice *mTouchDevice = nullptr; QSharedPointer mPixmapCursor; friend class QWaylandTouchExtension; friend class QWaylandQtKeyExtension; }; inline uint32_t QWaylandInputDevice::serial() const { return mSerial; } class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Keyboard : public QObject, public QtWayland::wl_keyboard { Q_OBJECT public: Keyboard(QWaylandInputDevice *p); ~Keyboard() override; void stopRepeat(); void keyboard_keymap(uint32_t format, int32_t fd, uint32_t size) override; void keyboard_enter(uint32_t time, struct wl_surface *surface, struct wl_array *keys) override; void keyboard_leave(uint32_t time, struct wl_surface *surface) override; void keyboard_key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state) override; void keyboard_modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) override; QWaylandInputDevice *mParent = nullptr; QPointer mFocus; #if QT_CONFIG(xkbcommon_evdev) xkb_context *mXkbContext = nullptr; xkb_keymap *mXkbMap = nullptr; xkb_state *mXkbState = nullptr; xkb_compose_table *mXkbComposeTable = nullptr; xkb_compose_state *mXkbComposeState = nullptr; #endif uint32_t mNativeModifiers = 0; int mRepeatKey; uint32_t mRepeatCode; uint32_t mRepeatTime; QString mRepeatText; #if QT_CONFIG(xkbcommon_evdev) xkb_keysym_t mRepeatSym; #endif QTimer mRepeatTimer; Qt::KeyboardModifiers modifiers() const; private slots: void repeatKey(); private: #if QT_CONFIG(xkbcommon_evdev) bool createDefaultKeyMap(); void releaseKeyMap(); void createComposeState(); void releaseComposeState(); #endif }; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Pointer : public QtWayland::wl_pointer { public: Pointer(QWaylandInputDevice *p); ~Pointer() override; void pointer_enter(uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) override; void pointer_leave(uint32_t time, struct wl_surface *surface) override; void pointer_motion(uint32_t time, wl_fixed_t sx, wl_fixed_t sy) override; void pointer_button(uint32_t serial, uint32_t time, uint32_t button, uint32_t state) override; void pointer_axis(uint32_t time, uint32_t axis, wl_fixed_t value) override; void releaseButtons(); QWaylandInputDevice *mParent = nullptr; QPointer mFocus; uint32_t mEnterSerial = 0; #if QT_CONFIG(cursor) uint32_t mCursorSerial = 0; #endif QPointF mSurfacePos; QPointF mGlobalPos; Qt::MouseButtons mButtons = Qt::NoButton; #if QT_CONFIG(cursor) wl_buffer *mCursorBuffer = nullptr; Qt::CursorShape mCursorShape = Qt::BitmapCursor; #endif }; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDevice::Touch : public QtWayland::wl_touch { public: Touch(QWaylandInputDevice *p); ~Touch() override; void touch_down(uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y) override; void touch_up(uint32_t serial, uint32_t time, int32_t id) override; void touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) override; void touch_frame() override; void touch_cancel() override; bool allTouchPointsReleased(); void releasePoints(); QWaylandInputDevice *mParent = nullptr; QPointer mFocus; QList mTouchPoints; QList mPrevTouchPoints; }; class QWaylandPointerEvent { public: enum Type { Enter, Motion, Wheel }; inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, Qt::MouseButtons b, Qt::KeyboardModifiers m) : type(t) , timestamp(ts) , local(l) , global(g) , buttons(b) , modifiers(m) {} inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad, Qt::KeyboardModifiers m) : type(t) , timestamp(ts) , local(l) , global(g) , modifiers(m) , pixelDelta(pd) , angleDelta(ad) {} Type type; ulong timestamp; QPointF local; QPointF global; Qt::MouseButtons buttons; Qt::KeyboardModifiers modifiers; QPoint pixelDelta; QPoint angleDelta; }; } QT_END_NAMESPACE #endif qwaylandinputdeviceintegration_p.h000066400000000000000000000017241476226662200362040ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATION_H #define QWAYLANDINPUTDEVICEINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegration { public: QWaylandInputDeviceIntegration() {} virtual ~QWaylandInputDeviceIntegration() {} virtual QWaylandInputDevice *createInputDevice(QWaylandDisplay *d, int version, uint32_t id) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICEINTEGRATION_H qwaylandinputdeviceintegrationfactory_p.h000066400000000000000000000017341476226662200375750ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H #define QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandInputDeviceIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICENTEGRATIONFACTORY_H qwaylandinputdeviceintegrationplugin_p.h000066400000000000000000000023521476226662200374210ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 LG Electronics Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H #define QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandInputDeviceIntegration; #define QWaylandInputDeviceIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandInputDeviceIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = nullptr); ~QWaylandInputDeviceIntegrationPlugin() override; virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H qwaylandintegration_p.h000066400000000000000000000076351476226662200337530ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPLATFORMINTEGRATION_WAYLAND_H #define QPLATFORMINTEGRATION_WAYLAND_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandBuffer; class QWaylandDisplay; class QWaylandClientBufferIntegration; class QWaylandServerBufferIntegration; class QWaylandShellIntegration; class QWaylandInputDeviceIntegration; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration { public: QWaylandIntegration(); ~QWaylandIntegration() override; bool hasFailed() { return mFailed; } bool hasCapability(QPlatformIntegration::Capability cap) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; #if QT_CONFIG(opengl) QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface() const override; #if QT_CONFIG(clipboard) QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; QVariant styleHint(StyleHint hint) const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; QWaylandDisplay *display() const; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id); virtual QWaylandClientBufferIntegration *clientBufferIntegration() const; virtual QWaylandServerBufferIntegration *serverBufferIntegration() const; virtual QWaylandShellIntegration *shellIntegration() const; private: // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration. // Do not move this definition into the private section at the bottom. QScopedPointer mDisplay; protected: QScopedPointer mClientBufferIntegration; QScopedPointer mServerBufferIntegration; QScopedPointer mShellIntegration; QScopedPointer mInputDeviceIntegration; private: void initializeClientBufferIntegration(); void initializeServerBufferIntegration(); void initializeShellIntegration(); void initializeInputDeviceIntegration(); QWaylandShellIntegration *createShellIntegration(const QString& interfaceName); QScopedPointer mFontDb; #if QT_CONFIG(clipboard) QScopedPointer mClipboard; #endif #if QT_CONFIG(draganddrop) QScopedPointer mDrag; #endif QScopedPointer mNativeInterface; QScopedPointer mInputContext; #if QT_CONFIG(accessibility) QScopedPointer mAccessibility; #endif bool mFailed = false; bool mClientBufferIntegrationInitialized = false; bool mServerBufferIntegrationInitialized = false; bool mShellIntegrationInitialized = false; friend class QWaylandDisplay; }; } QT_END_NAMESPACE #endif qwaylandnativeinterface_p.h000066400000000000000000000041351476226662200345670ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDNATIVEINTERFACE_H #define QWAYLANDNATIVEINTERFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandIntegration; class QWaylandScreen; class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface { public: QWaylandNativeInterface(QWaylandIntegration *integration); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForScreen(const QByteArray &resourceString, QScreen *screen) override; #if QT_CONFIG(opengl) void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; #endif QVariantMap windowProperties(QPlatformWindow *window) const override; QVariant windowProperty(QPlatformWindow *window, const QString &name) const override; QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override; void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override; void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); QFunctionPointer platformFunction(const QByteArray &resource) const override; private: QWaylandIntegration *m_integration = nullptr; QHash m_windowProperties; static void setSync(QWindow *window); static void setDeSync(QWindow *window); static bool isSync(QWindow *window); }; } QT_END_NAMESPACE #endif // QWAYLANDNATIVEINTERFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandqtkey_p.h000066400000000000000000000026031476226662200326320ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDQTKEY_H #define QWAYLANDQTKEY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandQtKeyExtension : public QtWayland::zqt_key_v1 { public: QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); private: QWaylandDisplay *m_display = nullptr; void zqt_key_v1_key(struct wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const QString &text, uint32_t autorep, uint32_t count) override; }; } QT_END_NAMESPACE #endif // QWAYLANDQTKEY_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandscreen_p.h000066400000000000000000000064011476226662200327540ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSCREEN_H #define QWAYLANDSCREEN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandCursor; class Q_WAYLAND_CLIENT_EXPORT QWaylandScreen : public QPlatformScreen, QtWayland::wl_output, QtWayland::zxdg_output_v1 { public: QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id); ~QWaylandScreen() override; void initXdgOutput(QtWayland::zxdg_output_manager_v1 *xdgOutputManager); QWaylandDisplay *display() const; QString manufacturer() const override; QString model() const override; QRect geometry() const override; int depth() const override; QImage::Format format() const override; QSizeF physicalSize() const override; QDpi logicalDpi() const override; QList virtualSiblings() const override; void setOrientationUpdateMask(Qt::ScreenOrientations mask) override; Qt::ScreenOrientation orientation() const override; int scale() const; qreal devicePixelRatio() const override; qreal refreshRate() const override; QString name() const override { return mOutputName; } #if QT_CONFIG(cursor) QPlatformCursor *cursor() const override; QWaylandCursor *waylandCursor(); #endif uint32_t outputId() const { return m_outputId; } ::wl_output *output() { return QtWayland::wl_output::object(); } static QWaylandScreen *waylandScreenFromWindow(QWindow *window); static QWaylandScreen *fromWlOutput(::wl_output *output); private: void output_mode(uint32_t flags, int width, int height, int refresh) override; void output_geometry(int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const QString &make, const QString &model, int32_t transform) override; void output_scale(int32_t factor) override; void output_done() override; // XdgOutput void zxdg_output_v1_logical_position(int32_t x, int32_t y) override; void zxdg_output_v1_logical_size(int32_t width, int32_t height) override; void zxdg_output_v1_done() override; int m_outputId; QWaylandDisplay *mWaylandDisplay = nullptr; QString mManufacturer; QString mModel; QRect mGeometry; QRect mXdgGeometry; int mScale = 1; int mDepth = 32; int mRefreshRate = 60000; int mTransform = -1; QImage::Format mFormat = QImage::Format_ARGB32_Premultiplied; QSize mPhysicalSize; QString mOutputName; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; #if QT_CONFIG(cursor) QScopedPointer mWaylandCursor; #endif }; } QT_END_NAMESPACE #endif // QWAYLANDSCREEN_H qwaylandserverbufferintegration_p.h000066400000000000000000000027421476226662200363660ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2019 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATION_H #define QWAYLANDSERVERBUFFERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE class QOpenGLTexture; namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer { public: enum Format { RGBA32, A8 }; QWaylandServerBuffer(); virtual ~QWaylandServerBuffer(); virtual QOpenGLTexture *toOpenGlTexture() = 0; Format format() const; QSize size() const; void setUserData(void *userData); void *userData() const; protected: Format m_format; QSize m_size; private: void *m_user_data = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration { public: QWaylandServerBufferIntegration(); virtual ~QWaylandServerBufferIntegration(); virtual void initialize(QWaylandDisplay *display) = 0; virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0; }; } QT_END_NAMESPACE #endif qwaylandserverbufferintegrationfactory_p.h000066400000000000000000000017441476226662200377570ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H #define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandServerBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H qwaylandserverbufferintegrationplugin_p.h000066400000000000000000000023651476226662200376060ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandServerBufferIntegration; #define QWaylandServerBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandServerBufferIntegrationPlugin() override; virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H qwaylandshellintegration_p.h000066400000000000000000000030111476226662200347630ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATION_H #define QWAYLANDSHELLINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandShellSurface; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegration { public: QWaylandShellIntegration() {} virtual ~QWaylandShellIntegration() {} virtual bool initialize(QWaylandDisplay *display) { m_display = display; return true; } virtual QWaylandShellSurface *createShellSurface(QWaylandWindow *window) = 0; virtual void handleKeyboardFocusChanged(QWaylandWindow *newFocus, QWaylandWindow *oldFocus) { if (newFocus) m_display->handleWindowActivated(newFocus); if (oldFocus) m_display->handleWindowDeactivated(oldFocus); } virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) { Q_UNUSED(resource); Q_UNUSED(window); return nullptr; } protected: QWaylandDisplay *m_display = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATION_H qwaylandshellintegrationfactory_p.h000066400000000000000000000020231476226662200363550ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATIONFACTORY_H #define QWAYLANDSHELLINTEGRATIONFACTORY_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandShellIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory { public: static QStringList keys(const QString &pluginPath = QString()); static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString()); }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATIONFACTORY_H qwaylandshellintegrationplugin_p.h000066400000000000000000000022451476226662200362120ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLINTEGRATIONPLUGIN_H #define QWAYLANDSHELLINTEGRATIONPLUGIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandShellIntegration; #define QWaylandShellIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandShellIntegrationFactoryInterface.5.3" class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject { Q_OBJECT public: explicit QWaylandShellIntegrationPlugin(QObject *parent = nullptr); ~QWaylandShellIntegrationPlugin() override; virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLINTEGRATIONPLUGIN_H qwaylandshellsurface_p.h000066400000000000000000000037271476226662200341060ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2021 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHELLSURFACE_H #define QWAYLANDSHELLSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE class QVariant; class QWindow; namespace QtWaylandClient { class QWaylandWindow; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QObject { Q_OBJECT public: explicit QWaylandShellSurface(QWaylandWindow *window); ~QWaylandShellSurface() override {} virtual void resize(QWaylandInputDevice * /*inputDevice*/, enum wl_shell_surface_resize /*edges*/) {} virtual bool move(QWaylandInputDevice *) { return false; } virtual void setTitle(const QString & /*title*/) {} virtual void setAppId(const QString & /*appId*/) {} virtual void setWindowFlags(Qt::WindowFlags flags); virtual bool isExposed() const { return true; } virtual bool handleExpose(const QRegion &) { return false; } virtual void raise() {} virtual void lower() {} virtual void setContentOrientationMask(Qt::ScreenOrientations orientation) { Q_UNUSED(orientation) } virtual void sendProperty(const QString &name, const QVariant &value); inline QWaylandWindow *window() { return m_window; } virtual void applyConfigure() {} virtual void requestWindowStates(Qt::WindowStates states) {Q_UNUSED(states);} virtual bool wantsDecorations() const { return false; } private: QWaylandWindow *m_window = nullptr; friend class QWaylandWindow; }; } QT_END_NAMESPACE #endif // QWAYLANDSHELLSURFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandshm_p.h000066400000000000000000000022671476226662200322720ustar00rootroot00000000000000// Copyright (C) 2016 LG Electronics Inc, author: // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHM_H #define QWAYLANDSHM_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class Q_WAYLAND_CLIENT_EXPORT QWaylandShm : public QtWayland::wl_shm { public: QWaylandShm(QWaylandDisplay *display, int version, uint32_t id); ~QWaylandShm() override; bool formatSupported(wl_shm_format format) const; bool formatSupported(QImage::Format format) const; static wl_shm_format formatFrom(QImage::Format format); static QImage::Format formatFrom(wl_shm_format format); protected: void shm_format(uint32_t format) override; private: QVector m_formats; }; } QT_END_NAMESPACE #endif qwaylandshmbackingstore_p.h000066400000000000000000000051731476226662200346060ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHMBACKINGSTORE_H #define QWAYLANDSHMBACKINGSTORE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandAbstractDecoration; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBuffer : public QWaylandBuffer { public: QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale = 1); ~QWaylandShmBuffer() override; QSize size() const override { return mImage.size(); } int scale() const override { return int(mImage.devicePixelRatio()); } QImage *image() { return &mImage; } QImage *imageInsideMargins(const QMargins &margins); private: QImage mImage; struct wl_shm_pool *mShmPool = nullptr; QMargins mMargins; QImage *mMarginsImage = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore { public: QWaylandShmBackingStore(QWindow *window); ~QWaylandShmBackingStore() override; QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; void resize(const QSize &size, const QRegion &staticContents) override; void resize(const QSize &size); void beginPaint(const QRegion ®ion) override; void endPaint() override; QWaylandAbstractDecoration *windowDecoration() const; QMargins windowDecorationMargins() const; QImage *entireSurface() const; QImage *contentSurface() const; void ensureSize(); QWaylandWindow *waylandWindow() const; void iterateBuffer(); #if QT_CONFIG(opengl) QImage toImage() const override; #endif private: void updateDecorations(); QWaylandShmBuffer *getBuffer(const QSize &size); QWaylandDisplay *mDisplay = nullptr; QLinkedList mBuffers; QWaylandShmBuffer *mFrontBuffer = nullptr; QWaylandShmBuffer *mBackBuffer = nullptr; bool mPainting = false; bool mPendingFlush = false; QRegion mPendingRegion; QMutex mMutex; QSize mRequestedSize; Qt::WindowFlags mCurrentWindowFlags; }; } QT_END_NAMESPACE #endif qwaylandshmwindow_p.h000066400000000000000000000015611476226662200334370ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSHMWINDOW_H #define QWAYLANDSHMWINDOW_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandShmWindow : public QWaylandWindow { public: QWaylandShmWindow(QWindow *window); ~QWaylandShmWindow() override; WindowType windowType() const override; QSurfaceFormat format() const override { return QSurfaceFormat(); } }; } QT_END_NAMESPACE #endif // QWAYLANDSHMWINDOW_H qwaylandsubsurface_p.h000066400000000000000000000030111476226662200335520ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDSUBSURFACE_H #define QWAYLANDSUBSURFACE_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandWindow; class Q_WAYLAND_CLIENT_EXPORT QWaylandSubSurface : public QtWayland::wl_subsurface { public: QWaylandSubSurface(QWaylandWindow *window, QWaylandWindow *parent, ::wl_subsurface *subsurface); ~QWaylandSubSurface() override; QWaylandWindow *window() const { return m_window; } QWaylandWindow *parent() const { return m_parent; } void setSync(); void setDeSync(); bool isSync() const { return m_synchronized; } QMutex *syncMutex() { return &m_syncLock; } private: // Intentionally hide public methods from ::wl_subsurface // to keep track of the sync state void set_sync(); void set_desync(); QWaylandWindow *m_window = nullptr; QWaylandWindow *m_parent = nullptr; bool m_synchronized = false; QMutex m_syncLock; }; QT_END_NAMESPACE } #endif // QWAYLANDSUBSURFACE_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandtouch_p.h000066400000000000000000000042101476226662200326130ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDTOUCH_H #define QWAYLANDTOUCH_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandDisplay; class QWaylandInputDevice; class Q_WAYLAND_CLIENT_EXPORT QWaylandTouchExtension : public QtWayland::qt_touch_extension { public: QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id); void touchCanceled(); private: void registerDevice(int caps); QWaylandDisplay *mDisplay = nullptr; void touch_extension_touch(uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, struct wl_array *rawdata) override; void touch_extension_configure(uint32_t flags) override; void sendTouchEvent(); QList mTouchPoints; QList mPrevTouchPoints; QTouchDevice *mTouchDevice = nullptr; uint32_t mTimestamp; int mPointsLeft; uint32_t mFlags; int mMouseSourceId; QPointF mLastMouseLocal; QPointF mLastMouseGlobal; QWindow *mTargetWindow = nullptr; QWaylandInputDevice *mInputDevice = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDTOUCH_H qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandwindow_p.h000066400000000000000000000201511476226662200330020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWINDOW_H #define QWAYLANDWINDOW_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include #include #include #include #include struct wl_egl_window; QT_BEGIN_NAMESPACE namespace QtWaylandClient { Q_DECLARE_LOGGING_CATEGORY(lcWaylandBackingstore) class QWaylandDisplay; class QWaylandBuffer; class QWaylandShellSurface; class QWaylandSubSurface; class QWaylandAbstractDecoration; class QWaylandInputDevice; class QWaylandScreen; class QWaylandShmBackingStore; class QWaylandPointerEvent; class QWaylandSurface; class Q_WAYLAND_CLIENT_EXPORT QWaylandWindow : public QObject , public QPlatformWindow { Q_OBJECT public: enum WindowType { Shm, Egl, Vulkan }; QWaylandWindow(QWindow *window, QWaylandDisplay *display); ~QWaylandWindow() override; virtual WindowType windowType() const = 0; virtual void ensureSize(); WId winId() const override; void setVisible(bool visible) override; void setParent(const QPlatformWindow *parent) override; void setWindowTitle(const QString &title) override; inline QIcon windowIcon() const; void setWindowIcon(const QIcon &icon) override; void setGeometry(const QRect &rect) override; void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset = {0, 0}); void applyConfigureWhenPossible(); //rename to possible? void attach(QWaylandBuffer *buffer, int x, int y); void attachOffset(QWaylandBuffer *buffer); QPoint attachOffset() const; void damage(const QRect &rect); void safeCommit(QWaylandBuffer *buffer, const QRegion &damage); void handleExpose(const QRegion ®ion); void commit(QWaylandBuffer *buffer, const QRegion &damage); void commit(); bool waitForFrameSync(int timeout); QMargins frameMargins() const override; QSize surfaceSize() const; QRect windowContentGeometry() const; QPointF mapFromWlSurface(const QPointF &surfacePosition) const; QWaylandSurface *waylandSurface() const { return mSurface.data(); } ::wl_surface *wlSurface(); static QWaylandWindow *fromWlSurface(::wl_surface *surface); QWaylandDisplay *display() const { return mDisplay; } QWaylandShellSurface *shellSurface() const; QWaylandSubSurface *subSurfaceWindow() const; QWaylandScreen *waylandScreen() const; void handleContentOrientationChange(Qt::ScreenOrientation orientation) override; void setOrientationMask(Qt::ScreenOrientations mask); void setWindowState(Qt::WindowStates states) override; void setWindowFlags(Qt::WindowFlags flags) override; void handleWindowStatesChanged(Qt::WindowStates states); void raise() override; void lower() override; void setMask(const QRegion ®ion) override; int scale() const; qreal devicePixelRatio() const override; void requestActivateWindow() override; bool isExposed() const override; bool isActive() const override; QWaylandAbstractDecoration *decoration() const; void handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); bool touchDragDecoration(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods); bool createDecoration(); #if QT_CONFIG(cursor) void setMouseCursor(QWaylandInputDevice *device, const QCursor &cursor); void restoreMouseCursor(QWaylandInputDevice *device); #endif QWaylandWindow *transientParent() const; QMutex *resizeMutex() { return &mResizeLock; } void doApplyConfigure(); void setCanResize(bool canResize); bool setMouseGrabEnabled(bool grab) override; static QWaylandWindow *mouseGrab() { return mMouseGrab; } void sendProperty(const QString &name, const QVariant &value); void setProperty(const QString &name, const QVariant &value); QVariantMap properties() const; QVariant property(const QString &name); QVariant property(const QString &name, const QVariant &defaultValue); void setBackingStore(QWaylandShmBackingStore *backingStore) { mBackingStore = backingStore; } QWaylandShmBackingStore *backingStore() const { return mBackingStore; } bool setKeyboardGrabEnabled(bool) override { return false; } void propagateSizeHints() override; void addAttachOffset(const QPoint point); bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void timerEvent(QTimerEvent *event) override; void requestUpdate() override; void handleUpdate(); void deliverUpdateRequest() override; public slots: void applyConfigure(); signals: void wlSurfaceCreated(); void wlSurfaceDestroyed(); protected: QWaylandDisplay *mDisplay = nullptr; QScopedPointer mSurface; QWaylandShellSurface *mShellSurface = nullptr; QWaylandSubSurface *mSubSurfaceWindow = nullptr; QVector mChildren; QWaylandAbstractDecoration *mWindowDecoration = nullptr; bool mMouseEventsInContentArea = false; Qt::MouseButtons mMousePressedInContentArea = Qt::NoButton; WId mWindowId; bool mWaitingForFrameCallback = false; bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out int mFrameCallbackCheckIntervalTimerId = -1; QElapsedTimer mFrameCallbackElapsedTimer; struct ::wl_callback *mFrameCallback = nullptr; struct ::wl_event_queue *mFrameQueue = nullptr; QWaitCondition mFrameSyncWait; // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer bool mWaitingForUpdate = false; QMutex mResizeLock; bool mWaitingToApplyConfigure = false; bool mCanResize = true; bool mResizeDirty = false; bool mResizeAfterSwap; int mFrameCallbackTimeout = 100; QVariantMap m_properties; bool mSentInitialResize = false; QPoint mOffset; int mScale = 1; QPlatformScreen *mLastReportedScreen = nullptr; QIcon mWindowIcon; Qt::WindowFlags mFlags; QRegion mMask; Qt::WindowStates mLastReportedWindowStates = Qt::WindowNoState; QWaylandShmBackingStore *mBackingStore = nullptr; QWaylandBuffer *mQueuedBuffer = nullptr; QRegion mQueuedBufferDamage; private: void setGeometry_helper(const QRect &rect); void initWindow(); void initializeWlSurface(); bool shouldCreateShellSurface() const; bool shouldCreateSubSurface() const; void reset(); void sendExposeEvent(const QRect &rect); static void closePopups(QWaylandWindow *parent); QPlatformScreen *calculateScreenFromSurfaceEvents() const; void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); void handleScreensChanged(); bool mInResizeFromApplyConfigure = false; bool lastVisible = false; QRect mLastExposeGeometry; static const wl_callback_listener callbackListener; void handleFrameCallback(); static QMutex mFrameSyncMutex; static QWaylandWindow *mMouseGrab; QReadWriteLock mSurfaceLock; friend class QWaylandSubSurface; }; inline QIcon QWaylandWindow::windowIcon() const { return mWindowIcon; } inline QPoint QWaylandWindow::attachOffset() const { return mOffset; } } // namespace QtWaylandClient QT_END_NAMESPACE #endif // QWAYLANDWINDOW_H qwaylandwindowmanagerintegration_p.h000066400000000000000000000034251476226662200365270ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H #define QWAYLANDWINDOWMANAGERINTEGRATION_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandWindow; class QWaylandDisplay; class QWaylandWindowManagerIntegrationPrivate; class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QGenericUnixServices, public QtWayland::qt_windowmanager { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration) public: explicit QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay); ~QWaylandWindowManagerIntegration() override; bool openUrl(const QUrl &url) override; bool openDocument(const QUrl &url) override; bool showIsFullScreen() const; private: static void wlHandleListenerGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); QScopedPointer d_ptr; void windowmanager_hints(int32_t showIsFullScreen) override; void windowmanager_quit() override; void openUrl_helper(const QUrl &url); }; QT_END_NAMESPACE } #endif // QWAYLANDWINDOWMANAGERINTEGRATION_H qwaylandwlshellintegration_p.h000066400000000000000000000021131476226662200353300ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 Jolla Ltd // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDWLSHELLINTEGRATION_P_H #define QWAYLANDWLSHELLINTEGRATION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellIntegration : public QWaylandShellIntegration { public: static QWaylandWlShellIntegration *create(QWaylandDisplay* display); bool initialize(QWaylandDisplay *) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; private: QWaylandWlShellIntegration(QWaylandDisplay* display); QtWayland::wl_shell *m_wlShell = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDWLSHELLINTEGRATION_P_H qwaylandxdgshellv6integration_p.h000066400000000000000000000021431476226662200357470ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QWAYLANDXDGSHELLV6INTEGRATION_P_H #define QWAYLANDXDGSHELLV6INTEGRATION_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE namespace QtWaylandClient { class QWaylandXdgShellV6; class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgShellV6Integration : public QWaylandShellIntegration { public: static QWaylandXdgShellV6Integration *create(QWaylandDisplay* display); bool initialize(QWaylandDisplay *display) override; QWaylandShellSurface *createShellSurface(QWaylandWindow *window) override; private: QWaylandXdgShellV6Integration(QWaylandDisplay *display); QWaylandXdgShellV6 *m_xdgShell = nullptr; }; } QT_END_NAMESPACE #endif // QWAYLANDXDGSHELLV6INTEGRATION_P_H wayland-hardware-integration-client-protocol.h000066400000000000000000000115661476226662200402340ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef HARDWARE_INTEGRATION_CLIENT_PROTOCOL_H #define HARDWARE_INTEGRATION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_hardware_integration The hardware_integration protocol * @section page_ifaces_hardware_integration Interfaces * - @subpage page_iface_qt_hardware_integration - compostors communicates supported buffer sharing extensions * @section page_copyright_hardware_integration Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_hardware_integration; /** * @page page_iface_qt_hardware_integration qt_hardware_integration * @section page_iface_qt_hardware_integration_desc Description * * Using this protocol the compositor can signal to clients which buffer sharing extensions * the client should use * @section page_iface_qt_hardware_integration_api API * See @ref iface_qt_hardware_integration. */ /** * @defgroup iface_qt_hardware_integration The qt_hardware_integration interface * * Using this protocol the compositor can signal to clients which buffer sharing extensions * the client should use */ extern const struct wl_interface qt_hardware_integration_interface; /** * @ingroup iface_qt_hardware_integration * @struct qt_hardware_integration_listener */ struct qt_hardware_integration_listener { /** */ void (*client_backend)(void *data, struct qt_hardware_integration *qt_hardware_integration, const char *name); /** */ void (*server_backend)(void *data, struct qt_hardware_integration *qt_hardware_integration, const char *name); }; /** * @ingroup iface_qt_hardware_integration */ static inline int qt_hardware_integration_add_listener(struct qt_hardware_integration *qt_hardware_integration, const struct qt_hardware_integration_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_hardware_integration, (void (**)(void)) listener, data); } /** * @ingroup iface_qt_hardware_integration */ #define QT_HARDWARE_INTEGRATION_CLIENT_BACKEND_SINCE_VERSION 1 /** * @ingroup iface_qt_hardware_integration */ #define QT_HARDWARE_INTEGRATION_SERVER_BACKEND_SINCE_VERSION 1 /** @ingroup iface_qt_hardware_integration */ static inline void qt_hardware_integration_set_user_data(struct qt_hardware_integration *qt_hardware_integration, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_hardware_integration, user_data); } /** @ingroup iface_qt_hardware_integration */ static inline void * qt_hardware_integration_get_user_data(struct qt_hardware_integration *qt_hardware_integration) { return wl_proxy_get_user_data((struct wl_proxy *) qt_hardware_integration); } static inline uint32_t qt_hardware_integration_get_version(struct qt_hardware_integration *qt_hardware_integration) { return wl_proxy_get_version((struct wl_proxy *) qt_hardware_integration); } /** @ingroup iface_qt_hardware_integration */ static inline void qt_hardware_integration_destroy(struct qt_hardware_integration *qt_hardware_integration) { wl_proxy_destroy((struct wl_proxy *) qt_hardware_integration); } #ifdef __cplusplus } #endif #endif wayland-qt-key-unstable-v1-client-protocol.h000066400000000000000000000125371476226662200374660ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef QT_KEY_UNSTABLE_V1_CLIENT_PROTOCOL_H #define QT_KEY_UNSTABLE_V1_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_qt_key_unstable_v1 The qt_key_unstable_v1 protocol * @section page_ifaces_qt_key_unstable_v1 Interfaces * - @subpage page_iface_zqt_key_v1 - send serialized QKeyEvents * @section page_copyright_qt_key_unstable_v1 Copyright *
 *
 * Copyright (C) 2018 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct wl_surface; struct zqt_key_v1; /** * @page page_iface_zqt_key_v1 zqt_key_v1 * @section page_iface_zqt_key_v1_desc Description * * This protocol is independent of the Wayland seat concept. Its * intention is to let a QKeyEvent be transferred from a Qt compositor * to a Qt client without losing or adding false information by going * through wl_seat and wl_keyboard. * * Note: This protocol is considered private to Qt. We will do our * best to bump version numbers when we make backwards compatible * changes, bump the protocol name and interface suffixes when we make * backwards incompatible changes, but we provide no guarantees. We * may also remove the protocol without warning. Implement this at * your own risk. * @section page_iface_zqt_key_v1_api API * See @ref iface_zqt_key_v1. */ /** * @defgroup iface_zqt_key_v1 The zqt_key_v1 interface * * This protocol is independent of the Wayland seat concept. Its * intention is to let a QKeyEvent be transferred from a Qt compositor * to a Qt client without losing or adding false information by going * through wl_seat and wl_keyboard. * * Note: This protocol is considered private to Qt. We will do our * best to bump version numbers when we make backwards compatible * changes, bump the protocol name and interface suffixes when we make * backwards incompatible changes, but we provide no guarantees. We * may also remove the protocol without warning. Implement this at * your own risk. */ extern const struct wl_interface zqt_key_v1_interface; /** * @ingroup iface_zqt_key_v1 * @struct zqt_key_v1_listener */ struct zqt_key_v1_listener { /** * send key event * * The key event notifies the client that a QKeyEvent has * occurred on the server side. */ void (*key)(void *data, struct zqt_key_v1 *zqt_key_v1, struct wl_surface *surface, uint32_t time, uint32_t type, uint32_t key, uint32_t modifiers, uint32_t nativeScanCode, uint32_t nativeVirtualKey, uint32_t nativeModifiers, const char *text, uint32_t autorepeat, uint32_t count); }; /** * @ingroup iface_zqt_key_v1 */ static inline int zqt_key_v1_add_listener(struct zqt_key_v1 *zqt_key_v1, const struct zqt_key_v1_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zqt_key_v1, (void (**)(void)) listener, data); } /** * @ingroup iface_zqt_key_v1 */ #define ZQT_KEY_V1_KEY_SINCE_VERSION 1 /** @ingroup iface_zqt_key_v1 */ static inline void zqt_key_v1_set_user_data(struct zqt_key_v1 *zqt_key_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zqt_key_v1, user_data); } /** @ingroup iface_zqt_key_v1 */ static inline void * zqt_key_v1_get_user_data(struct zqt_key_v1 *zqt_key_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zqt_key_v1); } static inline uint32_t zqt_key_v1_get_version(struct zqt_key_v1 *zqt_key_v1) { return wl_proxy_get_version((struct wl_proxy *) zqt_key_v1); } /** @ingroup iface_zqt_key_v1 */ static inline void zqt_key_v1_destroy(struct zqt_key_v1 *zqt_key_v1) { wl_proxy_destroy((struct wl_proxy *) zqt_key_v1); } #ifdef __cplusplus } #endif #endif wayland-qt-windowmanager-client-protocol.h000066400000000000000000000113371476226662200373760ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef QT_WINDOWMANAGER_CLIENT_PROTOCOL_H #define QT_WINDOWMANAGER_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_qt_windowmanager The qt_windowmanager protocol * @section page_ifaces_qt_windowmanager Interfaces * - @subpage page_iface_qt_windowmanager - * @section page_copyright_qt_windowmanager Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_windowmanager; /** * @page page_iface_qt_windowmanager qt_windowmanager * @section page_iface_qt_windowmanager_api API * See @ref iface_qt_windowmanager. */ /** * @defgroup iface_qt_windowmanager The qt_windowmanager interface */ extern const struct wl_interface qt_windowmanager_interface; /** * @ingroup iface_qt_windowmanager * @struct qt_windowmanager_listener */ struct qt_windowmanager_listener { /** */ void (*hints)(void *data, struct qt_windowmanager *qt_windowmanager, int32_t show_is_fullscreen); /** */ void (*quit)(void *data, struct qt_windowmanager *qt_windowmanager); }; /** * @ingroup iface_qt_windowmanager */ static inline int qt_windowmanager_add_listener(struct qt_windowmanager *qt_windowmanager, const struct qt_windowmanager_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_windowmanager, (void (**)(void)) listener, data); } #define QT_WINDOWMANAGER_OPEN_URL 0 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_HINTS_SINCE_VERSION 1 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_QUIT_SINCE_VERSION 1 /** * @ingroup iface_qt_windowmanager */ #define QT_WINDOWMANAGER_OPEN_URL_SINCE_VERSION 1 /** @ingroup iface_qt_windowmanager */ static inline void qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data); } /** @ingroup iface_qt_windowmanager */ static inline void * qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager) { return wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager); } static inline uint32_t qt_windowmanager_get_version(struct qt_windowmanager *qt_windowmanager) { return wl_proxy_get_version((struct wl_proxy *) qt_windowmanager); } /** @ingroup iface_qt_windowmanager */ static inline void qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager) { wl_proxy_destroy((struct wl_proxy *) qt_windowmanager); } /** * @ingroup iface_qt_windowmanager * * If remaining is not 0 this is a multipart request, and * the server must concatenate subsequent requst urls to and * including a request where remaining is set to 0, before * it can handle the url. */ static inline void qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url) { wl_proxy_marshal((struct wl_proxy *) qt_windowmanager, QT_WINDOWMANAGER_OPEN_URL, remaining, url); } #ifdef __cplusplus } #endif #endif wayland-server-buffer-extension-client-protocol.h000066400000000000000000000106371476226662200407030ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef SERVER_BUFFER_EXTENSION_CLIENT_PROTOCOL_H #define SERVER_BUFFER_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_server_buffer_extension The server_buffer_extension protocol * @section page_ifaces_server_buffer_extension Interfaces * - @subpage page_iface_qt_server_buffer - buffers managed by the compositor * @section page_copyright_server_buffer_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_server_buffer; /** * @page page_iface_qt_server_buffer qt_server_buffer * @section page_iface_qt_server_buffer_desc Description * * Server buffer is an extension which makes it possible to share a * buffer created by the compositor to share it with arbitrary * clients. These types of buffers are intended to be read only * buffers for clients, but this is an implementation detail. * * Server buffers main purpose is to help implement caches * @section page_iface_qt_server_buffer_api API * See @ref iface_qt_server_buffer. */ /** * @defgroup iface_qt_server_buffer The qt_server_buffer interface * * Server buffer is an extension which makes it possible to share a * buffer created by the compositor to share it with arbitrary * clients. These types of buffers are intended to be read only * buffers for clients, but this is an implementation detail. * * Server buffers main purpose is to help implement caches */ extern const struct wl_interface qt_server_buffer_interface; #define QT_SERVER_BUFFER_RELEASE 0 /** * @ingroup iface_qt_server_buffer */ #define QT_SERVER_BUFFER_RELEASE_SINCE_VERSION 1 /** @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_set_user_data(struct qt_server_buffer *qt_server_buffer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_server_buffer, user_data); } /** @ingroup iface_qt_server_buffer */ static inline void * qt_server_buffer_get_user_data(struct qt_server_buffer *qt_server_buffer) { return wl_proxy_get_user_data((struct wl_proxy *) qt_server_buffer); } static inline uint32_t qt_server_buffer_get_version(struct qt_server_buffer *qt_server_buffer) { return wl_proxy_get_version((struct wl_proxy *) qt_server_buffer); } /** @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_destroy(struct qt_server_buffer *qt_server_buffer) { wl_proxy_destroy((struct wl_proxy *) qt_server_buffer); } /** * @ingroup iface_qt_server_buffer */ static inline void qt_server_buffer_release(struct qt_server_buffer *qt_server_buffer) { wl_proxy_marshal((struct wl_proxy *) qt_server_buffer, QT_SERVER_BUFFER_RELEASE); } #ifdef __cplusplus } #endif #endif wayland-surface-extension-client-protocol.h000066400000000000000000000225161476226662200375550ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef SURFACE_EXTENSION_CLIENT_PROTOCOL_H #define SURFACE_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_surface_extension The surface_extension protocol * @section page_ifaces_surface_extension Interfaces * - @subpage page_iface_qt_surface_extension - * - @subpage page_iface_qt_extended_surface - * @section page_copyright_surface_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_extended_surface; struct qt_surface_extension; struct wl_surface; /** * @page page_iface_qt_surface_extension qt_surface_extension * @section page_iface_qt_surface_extension_api API * See @ref iface_qt_surface_extension. */ /** * @defgroup iface_qt_surface_extension The qt_surface_extension interface */ extern const struct wl_interface qt_surface_extension_interface; /** * @page page_iface_qt_extended_surface qt_extended_surface * @section page_iface_qt_extended_surface_api API * See @ref iface_qt_extended_surface. */ /** * @defgroup iface_qt_extended_surface The qt_extended_surface interface */ extern const struct wl_interface qt_extended_surface_interface; #define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE 0 /** * @ingroup iface_qt_surface_extension */ #define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE_SINCE_VERSION 1 /** @ingroup iface_qt_surface_extension */ static inline void qt_surface_extension_set_user_data(struct qt_surface_extension *qt_surface_extension, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_surface_extension, user_data); } /** @ingroup iface_qt_surface_extension */ static inline void * qt_surface_extension_get_user_data(struct qt_surface_extension *qt_surface_extension) { return wl_proxy_get_user_data((struct wl_proxy *) qt_surface_extension); } static inline uint32_t qt_surface_extension_get_version(struct qt_surface_extension *qt_surface_extension) { return wl_proxy_get_version((struct wl_proxy *) qt_surface_extension); } /** @ingroup iface_qt_surface_extension */ static inline void qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension) { wl_proxy_destroy((struct wl_proxy *) qt_surface_extension); } /** * @ingroup iface_qt_surface_extension */ static inline struct qt_extended_surface * qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) qt_surface_extension, QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, &qt_extended_surface_interface, NULL, surface); return (struct qt_extended_surface *) id; } #ifndef QT_EXTENDED_SURFACE_ORIENTATION_ENUM #define QT_EXTENDED_SURFACE_ORIENTATION_ENUM enum qt_extended_surface_orientation { QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION = 0, QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION = 1, QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION = 2, QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION = 4, QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION = 8, }; #endif /* QT_EXTENDED_SURFACE_ORIENTATION_ENUM */ #ifndef QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM #define QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM enum qt_extended_surface_windowflag { QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES = 1, QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP = 2, QT_EXTENDED_SURFACE_WINDOWFLAG_BYPASSWINDOWMANAGER = 4, }; #endif /* QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM */ /** * @ingroup iface_qt_extended_surface * @struct qt_extended_surface_listener */ struct qt_extended_surface_listener { /** */ void (*onscreen_visibility)(void *data, struct qt_extended_surface *qt_extended_surface, int32_t visible); /** */ void (*set_generic_property)(void *data, struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value); /** */ void (*close)(void *data, struct qt_extended_surface *qt_extended_surface); }; /** * @ingroup iface_qt_extended_surface */ static inline int qt_extended_surface_add_listener(struct qt_extended_surface *qt_extended_surface, const struct qt_extended_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_extended_surface, (void (**)(void)) listener, data); } #define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY 0 #define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK 1 #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS 2 #define QT_EXTENDED_SURFACE_RAISE 3 #define QT_EXTENDED_SURFACE_LOWER 4 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_ONSCREEN_VISIBILITY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_GENERIC_PROPERTY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_CLOSE_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_RAISE_SINCE_VERSION 1 /** * @ingroup iface_qt_extended_surface */ #define QT_EXTENDED_SURFACE_LOWER_SINCE_VERSION 1 /** @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data); } /** @ingroup iface_qt_extended_surface */ static inline void * qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface) { return wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface); } static inline uint32_t qt_extended_surface_get_version(struct qt_extended_surface *qt_extended_surface) { return wl_proxy_get_version((struct wl_proxy *) qt_extended_surface); } /** @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface) { wl_proxy_destroy((struct wl_proxy *) qt_extended_surface); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_content_orientation_mask(struct qt_extended_surface *qt_extended_surface, int32_t orientation) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION_MASK, orientation); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_raise(struct qt_extended_surface *qt_extended_surface) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_RAISE); } /** * @ingroup iface_qt_extended_surface */ static inline void qt_extended_surface_lower(struct qt_extended_surface *qt_extended_surface) { wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, QT_EXTENDED_SURFACE_LOWER); } #ifdef __cplusplus } #endif #endif wayland-text-input-unstable-v2-client-protocol.h000066400000000000000000000730621476226662200403760ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef TEXT_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H #define TEXT_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_text_input_unstable_v2 The text_input_unstable_v2 protocol * @section page_ifaces_text_input_unstable_v2 Interfaces * - @subpage page_iface_zwp_text_input_v2 - text input * - @subpage page_iface_zwp_text_input_manager_v2 - text input manager * @section page_copyright_text_input_unstable_v2 Copyright *
 *
 * Copyright © 2012, 2013 Intel Corporation
 * Copyright © 2015, 2016 Jan Arne Petersen
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * 
*/ struct wl_seat; struct wl_surface; struct zwp_text_input_manager_v2; struct zwp_text_input_v2; /** * @page page_iface_zwp_text_input_v2 zwp_text_input_v2 * @section page_iface_zwp_text_input_v2_desc Description * * The zwp_text_input_v2 interface represents text input and input methods * associated with a seat. It provides enter/leave events to follow the * text input focus for a seat. * * Requests are used to enable/disable the text-input object and set * state information like surrounding and selected text or the content type. * The information about the entered text is sent to the text-input object * via the pre-edit and commit events. Using this interface removes the need * for applications to directly process hardware key events and compose text * out of them. * * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices * have to always point to the first byte of an UTF-8 encoded code point. * Lengths are not allowed to contain just a part of an UTF-8 encoded code * point. * * State is sent by the state requests (set_surrounding_text, * set_content_type, set_cursor_rectangle and set_preferred_language) and * an update_state request. After an enter or an input_method_change event * all state information is invalidated and needs to be resent from the * client. A reset or entering a new widget on client side also * invalidates all current state information. * @section page_iface_zwp_text_input_v2_api API * See @ref iface_zwp_text_input_v2. */ /** * @defgroup iface_zwp_text_input_v2 The zwp_text_input_v2 interface * * The zwp_text_input_v2 interface represents text input and input methods * associated with a seat. It provides enter/leave events to follow the * text input focus for a seat. * * Requests are used to enable/disable the text-input object and set * state information like surrounding and selected text or the content type. * The information about the entered text is sent to the text-input object * via the pre-edit and commit events. Using this interface removes the need * for applications to directly process hardware key events and compose text * out of them. * * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices * have to always point to the first byte of an UTF-8 encoded code point. * Lengths are not allowed to contain just a part of an UTF-8 encoded code * point. * * State is sent by the state requests (set_surrounding_text, * set_content_type, set_cursor_rectangle and set_preferred_language) and * an update_state request. After an enter or an input_method_change event * all state information is invalidated and needs to be resent from the * client. A reset or entering a new widget on client side also * invalidates all current state information. */ extern const struct wl_interface zwp_text_input_v2_interface; /** * @page page_iface_zwp_text_input_manager_v2 zwp_text_input_manager_v2 * @section page_iface_zwp_text_input_manager_v2_desc Description * * A factory for text-input objects. This object is a global singleton. * @section page_iface_zwp_text_input_manager_v2_api API * See @ref iface_zwp_text_input_manager_v2. */ /** * @defgroup iface_zwp_text_input_manager_v2 The zwp_text_input_manager_v2 interface * * A factory for text-input objects. This object is a global singleton. */ extern const struct wl_interface zwp_text_input_manager_v2_interface; #ifndef ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM #define ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM /** * @ingroup iface_zwp_text_input_v2 * content hint * * Content hint is a bitmask to allow to modify the behavior of the text * input. */ enum zwp_text_input_v2_content_hint { /** * no special behaviour */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_NONE = 0x0, /** * suggest word completions */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_COMPLETION = 0x1, /** * suggest word corrections */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CORRECTION = 0x2, /** * switch to uppercase letters at the start of a sentence */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4, /** * prefer lowercase letters */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_LOWERCASE = 0x8, /** * prefer uppercase letters */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_UPPERCASE = 0x10, /** * prefer casing for titles and headings (can be language dependent) */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_TITLECASE = 0x20, /** * characters should be hidden */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_HIDDEN_TEXT = 0x40, /** * typed text should not be stored */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_SENSITIVE_DATA = 0x80, /** * just latin characters should be entered */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_LATIN = 0x100, /** * the text input is multiline */ ZWP_TEXT_INPUT_V2_CONTENT_HINT_MULTILINE = 0x200, }; #endif /* ZWP_TEXT_INPUT_V2_CONTENT_HINT_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM #define ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM /** * @ingroup iface_zwp_text_input_v2 * content purpose * * The content purpose allows to specify the primary purpose of a text * input. * * This allows an input method to show special purpose input panels with * extra characters or to disallow some characters. */ enum zwp_text_input_v2_content_purpose { /** * default input, allowing all characters */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NORMAL = 0, /** * allow only alphabetic characters */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ALPHA = 1, /** * allow only digits */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DIGITS = 2, /** * input a number (including decimal separator and sign) */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NUMBER = 3, /** * input a phone number */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PHONE = 4, /** * input an URL */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_URL = 5, /** * input an email address */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_EMAIL = 6, /** * input a name of a person */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_NAME = 7, /** * input a password (combine with password or sensitive_data hint) */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_PASSWORD = 8, /** * input a date */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATE = 9, /** * input a time */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TIME = 10, /** * input a date and time */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_DATETIME = 11, /** * input for a terminal */ ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_TERMINAL = 12, }; #endif /* ZWP_TEXT_INPUT_V2_CONTENT_PURPOSE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM #define ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM /** * @ingroup iface_zwp_text_input_v2 * update_state flags * * Defines the reason for sending an updated state. */ enum zwp_text_input_v2_update_state { /** * updated state because it changed */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_CHANGE = 0, /** * full state after enter or input_method_changed event */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_FULL = 1, /** * full state after reset */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_RESET = 2, /** * full state after switching focus to a different widget on client side */ ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENTER = 3, }; #endif /* ZWP_TEXT_INPUT_V2_UPDATE_STATE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM #define ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM enum zwp_text_input_v2_input_panel_visibility { /** * the input panel (virtual keyboard) is hidden */ ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_HIDDEN = 0, /** * the input panel (virtual keyboard) is visible */ ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_VISIBLE = 1, }; #endif /* ZWP_TEXT_INPUT_V2_INPUT_PANEL_VISIBILITY_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM #define ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM enum zwp_text_input_v2_preedit_style { /** * default style for composing text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_DEFAULT = 0, /** * composing text should be shown the same as non-composing text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_NONE = 1, /** * composing text might be bold */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ACTIVE = 2, /** * composing text might be cursive */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INACTIVE = 3, /** * composing text might have a different background color */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_HIGHLIGHT = 4, /** * composing text might be underlined */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_UNDERLINE = 5, /** * composing text should be shown the same as selected text */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_SELECTION = 6, /** * composing text might be underlined with a red wavy line */ ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_INCORRECT = 7, }; #endif /* ZWP_TEXT_INPUT_V2_PREEDIT_STYLE_ENUM */ #ifndef ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM #define ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM enum zwp_text_input_v2_text_direction { /** * automatic text direction based on text and language */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_AUTO = 0, /** * left-to-right */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_LTR = 1, /** * right-to-left */ ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_RTL = 2, }; #endif /* ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_ENUM */ /** * @ingroup iface_zwp_text_input_v2 * @struct zwp_text_input_v2_listener */ struct zwp_text_input_v2_listener { /** * enter event * * Notification that this seat's text-input focus is on a certain * surface. * * When the seat has the keyboard capability the text-input focus * follows the keyboard focus. * @param serial serial to be used by update_state */ void (*enter)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, struct wl_surface *surface); /** * leave event * * Notification that this seat's text-input focus is no longer on * a certain surface. * * The leave notification is sent before the enter notification for * the new focus. * * When the seat has the keyboard capabillity the text-input focus * follows the keyboard focus. */ void (*leave)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, struct wl_surface *surface); /** * state of the input panel * * Notification that the visibility of the input panel (virtual * keyboard) changed. * * The rectangle x, y, width, height defines the area overlapped by * the input panel (virtual keyboard) on the surface having the * text focus in surface local coordinates. * * That can be used to make sure widgets are visible and not * covered by a virtual keyboard. */ void (*input_panel_state)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t state, int32_t x, int32_t y, int32_t width, int32_t height); /** * pre-edit * * Notify when a new composing text (pre-edit) should be set * around the current cursor position. Any previously set composing * text should be removed. * * The commit text can be used to replace the composing text in * some cases (for example when losing focus). * * The text input should also handle all preedit_style and * preedit_cursor events occurring directly before preedit_string. */ void (*preedit_string)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *text, const char *commit); /** * pre-edit styling * * Sets styling information on composing text. The style is * applied for length bytes from index relative to the beginning of * the composing text (as byte offset). Multiple styles can be * applied to a composing text by sending multiple preedit_styling * events. * * This event is handled as part of a following preedit_string * event. */ void (*preedit_styling)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t index, uint32_t length, uint32_t style); /** * pre-edit cursor * * Sets the cursor position inside the composing text (as byte * offset) relative to the start of the composing text. When index * is a negative number no cursor is shown. * * When no preedit_cursor event is sent the cursor will be at the * end of the composing text by default. * * This event is handled as part of a following preedit_string * event. */ void (*preedit_cursor)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t index); /** * commit * * Notify when text should be inserted into the editor widget. * The text to commit could be either just a single character after * a key press or the result of some composing (pre-edit). It could * be also an empty text when some text should be removed (see * delete_surrounding_text) or when the input cursor should be * moved (see cursor_position). * * Any previously set composing text should be removed. */ void (*commit_string)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *text); /** * set cursor to new position * * Notify when the cursor or anchor position should be modified. * * This event should be handled as part of a following * commit_string event. * * The text between anchor and index should be selected. * @param index position of cursor * @param anchor position of selection anchor */ void (*cursor_position)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t index, int32_t anchor); /** * delete surrounding text * * Notify when the text around the current cursor position should * be deleted. BeforeLength and afterLength is the length (in * bytes) of text before and after the current cursor position * (excluding the selection) to delete. * * This event should be handled as part of a following * commit_string or preedit_string event. * @param before_length length of text before current cursor positon * @param after_length length of text after current cursor positon */ void (*delete_surrounding_text)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t before_length, uint32_t after_length); /** * modifiers map * * Transfer an array of 0-terminated modifiers names. The * position in the array is the index of the modifier as used in * the modifiers bitmask in the keysym event. */ void (*modifiers_map)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_array *map); /** * keysym * * Notify when a key event was sent. Key events should not be * used for normal text input operations, which should be done with * commit_string, delete_surrounding_text, etc. The key event * follows the wl_keyboard key event convention. Sym is a XKB * keysym, state a wl_keyboard key_state. Modifiers are a mask for * effective modifiers (where the modifier indices are set by the * modifiers_map event) */ void (*keysym)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers); /** * language * * Sets the language of the input text. The "language" argument * is a RFC-3066 format language tag. */ void (*language)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, const char *language); /** * text direction * * Sets the text direction of input text. * * It is mainly needed for showing input cursor on correct side of * the editor when there is no input yet done and making sure * neutral direction text is laid out properly. */ void (*text_direction)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t direction); /** * configure amount of surrounding text to be sent * * Configure what amount of surrounding text is expected by the * input method. The surrounding text will be sent in the * set_surrounding_text request on the following state information * updates. */ void (*configure_surrounding_text)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, int32_t before_cursor, int32_t after_cursor); /** * Notifies about a changed input method * * The input method changed on compositor side, which invalidates * all current state information. New state information should be * sent from the client via state requests (set_surrounding_text, * set_content_hint, ...) and update_state. * @param serial serial to be used by update_state * @param flags currently unused */ void (*input_method_changed)(void *data, struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, uint32_t flags); }; /** * @ingroup iface_zwp_text_input_v2 */ static inline int zwp_text_input_v2_add_listener(struct zwp_text_input_v2 *zwp_text_input_v2, const struct zwp_text_input_v2_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v2, (void (**)(void)) listener, data); } #define ZWP_TEXT_INPUT_V2_DESTROY 0 #define ZWP_TEXT_INPUT_V2_ENABLE 1 #define ZWP_TEXT_INPUT_V2_DISABLE 2 #define ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL 3 #define ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL 4 #define ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT 5 #define ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE 6 #define ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE 7 #define ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE 8 #define ZWP_TEXT_INPUT_V2_UPDATE_STATE 9 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_ENTER_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_INPUT_PANEL_STATE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_STRING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_STYLING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_PREEDIT_CURSOR_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_COMMIT_STRING_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_CURSOR_POSITION_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_MODIFIERS_MAP_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_KEYSYM_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_LANGUAGE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_TEXT_DIRECTION_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_CONFIGURE_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_INPUT_METHOD_CHANGED_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_ENABLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_DISABLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_v2 */ #define ZWP_TEXT_INPUT_V2_UPDATE_STATE_SINCE_VERSION 1 /** @ingroup iface_zwp_text_input_v2 */ static inline void zwp_text_input_v2_set_user_data(struct zwp_text_input_v2 *zwp_text_input_v2, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v2, user_data); } /** @ingroup iface_zwp_text_input_v2 */ static inline void * zwp_text_input_v2_get_user_data(struct zwp_text_input_v2 *zwp_text_input_v2) { return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v2); } static inline uint32_t zwp_text_input_v2_get_version(struct zwp_text_input_v2 *zwp_text_input_v2) { return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v2); } /** * @ingroup iface_zwp_text_input_v2 * * Destroy the wp_text_input object. Also disables all surfaces enabled * through this wp_text_input object */ static inline void zwp_text_input_v2_destroy(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_DESTROY); wl_proxy_destroy((struct wl_proxy *) zwp_text_input_v2); } /** * @ingroup iface_zwp_text_input_v2 * * Enable text input in a surface (usually when a text entry inside of it * has focus). * * This can be called before or after a surface gets text (or keyboard) * focus via the enter event. Text input to a surface is only active * when it has the current text (or keyboard) focus and is enabled. */ static inline void zwp_text_input_v2_enable(struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_surface *surface) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_ENABLE, surface); } /** * @ingroup iface_zwp_text_input_v2 * * Disable text input in a surface (typically when there is no focus on any * text entry inside the surface). */ static inline void zwp_text_input_v2_disable(struct zwp_text_input_v2 *zwp_text_input_v2, struct wl_surface *surface) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_DISABLE, surface); } /** * @ingroup iface_zwp_text_input_v2 * * Requests input panels (virtual keyboard) to show. * * This should be used for example to show a virtual keyboard again * (with a tap) after it was closed by pressing on a close button on the * keyboard. */ static inline void zwp_text_input_v2_show_input_panel(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SHOW_INPUT_PANEL); } /** * @ingroup iface_zwp_text_input_v2 * * Requests input panels (virtual keyboard) to hide. */ static inline void zwp_text_input_v2_hide_input_panel(struct zwp_text_input_v2 *zwp_text_input_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_HIDE_INPUT_PANEL); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the plain surrounding text around the input position. Text is * UTF-8 encoded. Cursor is the byte offset within the surrounding text. * Anchor is the byte offset of the selection anchor within the * surrounding text. If there is no selected text, anchor is the same as * cursor. * * Make sure to always send some text before and after the cursor * except when the cursor is at the beginning or end of text. * * When there was a configure_surrounding_text event take the * before_cursor and after_cursor arguments into account for picking how * much surrounding text to send. * * There is a maximum length of wayland messages so text can not be * longer than 4000 bytes. */ static inline void zwp_text_input_v2_set_surrounding_text(struct zwp_text_input_v2 *zwp_text_input_v2, const char *text, int32_t cursor, int32_t anchor) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_SURROUNDING_TEXT, text, cursor, anchor); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the content purpose and content hint. While the purpose is the * basic purpose of an input field, the hint flags allow to modify some * of the behavior. * * When no content type is explicitly set, a normal content purpose with * none hint should be assumed. */ static inline void zwp_text_input_v2_set_content_type(struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t hint, uint32_t purpose) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_CONTENT_TYPE, hint, purpose); } /** * @ingroup iface_zwp_text_input_v2 * * Sets the cursor outline as a x, y, width, height rectangle in surface * local coordinates. * * Allows the compositor to put a window with word suggestions near the * cursor. */ static inline void zwp_text_input_v2_set_cursor_rectangle(struct zwp_text_input_v2 *zwp_text_input_v2, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_CURSOR_RECTANGLE, x, y, width, height); } /** * @ingroup iface_zwp_text_input_v2 * * Sets a specific language. This allows for example a virtual keyboard to * show a language specific layout. The "language" argument is a RFC-3066 * format language tag. * * It could be used for example in a word processor to indicate language of * currently edited document or in an instant message application which * tracks languages of contacts. */ static inline void zwp_text_input_v2_set_preferred_language(struct zwp_text_input_v2 *zwp_text_input_v2, const char *language) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_SET_PREFERRED_LANGUAGE, language); } /** * @ingroup iface_zwp_text_input_v2 * * Allows to atomically send state updates from client. * * This request should follow after a batch of state updating requests * like set_surrounding_text, set_content_type, set_cursor_rectangle and * set_preferred_language. * * The flags field indicates why an updated state is sent to the input * method. * * Reset should be used by an editor widget after the text was changed * outside of the normal input method flow. * * For "change" it is enough to send the changed state, else the full * state should be send. * * Serial should be set to the serial from the last enter or * input_method_changed event. * * To make sure to not receive outdated input method events after a * reset or switching to a new widget wl_display_sync() should be used * after update_state in these cases. */ static inline void zwp_text_input_v2_update_state(struct zwp_text_input_v2 *zwp_text_input_v2, uint32_t serial, uint32_t reason) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_v2, ZWP_TEXT_INPUT_V2_UPDATE_STATE, serial, reason); } #define ZWP_TEXT_INPUT_MANAGER_V2_DESTROY 0 #define ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT 1 /** * @ingroup iface_zwp_text_input_manager_v2 */ #define ZWP_TEXT_INPUT_MANAGER_V2_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zwp_text_input_manager_v2 */ #define ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT_SINCE_VERSION 1 /** @ingroup iface_zwp_text_input_manager_v2 */ static inline void zwp_text_input_manager_v2_set_user_data(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v2, user_data); } /** @ingroup iface_zwp_text_input_manager_v2 */ static inline void * zwp_text_input_manager_v2_get_user_data(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v2); } static inline uint32_t zwp_text_input_manager_v2_get_version(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v2); } /** * @ingroup iface_zwp_text_input_manager_v2 * * Destroy the wp_text_input_manager object. */ static inline void zwp_text_input_manager_v2_destroy(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2) { wl_proxy_marshal((struct wl_proxy *) zwp_text_input_manager_v2, ZWP_TEXT_INPUT_MANAGER_V2_DESTROY); wl_proxy_destroy((struct wl_proxy *) zwp_text_input_manager_v2); } /** * @ingroup iface_zwp_text_input_manager_v2 * * Creates a new text-input object for a given seat. */ static inline struct zwp_text_input_v2 * zwp_text_input_manager_v2_get_text_input(struct zwp_text_input_manager_v2 *zwp_text_input_manager_v2, struct wl_seat *seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_text_input_manager_v2, ZWP_TEXT_INPUT_MANAGER_V2_GET_TEXT_INPUT, &zwp_text_input_v2_interface, NULL, seat); return (struct zwp_text_input_v2 *) id; } #ifdef __cplusplus } #endif #endif wayland-touch-extension-client-protocol.h000066400000000000000000000121301476226662200372360ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef TOUCH_EXTENSION_CLIENT_PROTOCOL_H #define TOUCH_EXTENSION_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_touch_extension The touch_extension protocol * @section page_ifaces_touch_extension Interfaces * - @subpage page_iface_qt_touch_extension - * @section page_copyright_touch_extension Copyright *
 *
 * Copyright (C) 2015 The Qt Company Ltd.
 * Contact: http://www.qt.io/licensing/
 *
 * This file is part of the plugins of the Qt Toolkit.
 *
 * $QT_BEGIN_LICENSE:BSD$
 * You may use this file under the terms of the BSD license as follows:
 *
 * "Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 * * Neither the name of The Qt Company Ltd nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
 *
 * $QT_END_LICENSE$
 * 
*/ struct qt_touch_extension; /** * @page page_iface_qt_touch_extension qt_touch_extension * @section page_iface_qt_touch_extension_api API * See @ref iface_qt_touch_extension. */ /** * @defgroup iface_qt_touch_extension The qt_touch_extension interface */ extern const struct wl_interface qt_touch_extension_interface; #ifndef QT_TOUCH_EXTENSION_FLAGS_ENUM #define QT_TOUCH_EXTENSION_FLAGS_ENUM enum qt_touch_extension_flags { QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH = 0x1, }; #endif /* QT_TOUCH_EXTENSION_FLAGS_ENUM */ /** * @ingroup iface_qt_touch_extension * @struct qt_touch_extension_listener */ struct qt_touch_extension_listener { /** */ void (*touch)(void *data, struct qt_touch_extension *qt_touch_extension, uint32_t time, uint32_t id, uint32_t state, int32_t x, int32_t y, int32_t normalized_x, int32_t normalized_y, int32_t width, int32_t height, uint32_t pressure, int32_t velocity_x, int32_t velocity_y, uint32_t flags, struct wl_array *rawdata); /** */ void (*configure)(void *data, struct qt_touch_extension *qt_touch_extension, uint32_t flags); }; /** * @ingroup iface_qt_touch_extension */ static inline int qt_touch_extension_add_listener(struct qt_touch_extension *qt_touch_extension, const struct qt_touch_extension_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) qt_touch_extension, (void (**)(void)) listener, data); } #define QT_TOUCH_EXTENSION_DUMMY 0 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_TOUCH_SINCE_VERSION 1 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_qt_touch_extension */ #define QT_TOUCH_EXTENSION_DUMMY_SINCE_VERSION 1 /** @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data); } /** @ingroup iface_qt_touch_extension */ static inline void * qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension) { return wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension); } static inline uint32_t qt_touch_extension_get_version(struct qt_touch_extension *qt_touch_extension) { return wl_proxy_get_version((struct wl_proxy *) qt_touch_extension); } /** @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension) { wl_proxy_destroy((struct wl_proxy *) qt_touch_extension); } /** * @ingroup iface_qt_touch_extension */ static inline void qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension) { wl_proxy_marshal((struct wl_proxy *) qt_touch_extension, QT_TOUCH_EXTENSION_DUMMY); } #ifdef __cplusplus } #endif #endif wayland-wayland-client-protocol.h000066400000000000000000004054041476226662200355530ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef WAYLAND_CLIENT_PROTOCOL_H #define WAYLAND_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_wayland The wayland protocol * @section page_ifaces_wayland Interfaces * - @subpage page_iface_wl_display - core global object * - @subpage page_iface_wl_registry - global registry object * - @subpage page_iface_wl_callback - callback object * - @subpage page_iface_wl_compositor - the compositor singleton * - @subpage page_iface_wl_shm_pool - a shared memory pool * - @subpage page_iface_wl_shm - shared memory support * - @subpage page_iface_wl_buffer - content for a wl_surface * - @subpage page_iface_wl_data_offer - offer to transfer data * - @subpage page_iface_wl_data_source - offer to transfer data * - @subpage page_iface_wl_data_device - data transfer device * - @subpage page_iface_wl_data_device_manager - data transfer interface * - @subpage page_iface_wl_shell - create desktop-style surfaces * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface * - @subpage page_iface_wl_surface - an onscreen surface * - @subpage page_iface_wl_seat - group of input devices * - @subpage page_iface_wl_pointer - pointer input device * - @subpage page_iface_wl_keyboard - keyboard input device * - @subpage page_iface_wl_touch - touchscreen input device * - @subpage page_iface_wl_output - compositor output region * - @subpage page_iface_wl_region - region interface * - @subpage page_iface_wl_subcompositor - sub-surface compositing * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface * @section page_copyright_wayland Copyright *
 *
 * Copyright © 2008-2011 Kristian Høgsberg
 * Copyright © 2010-2011 Intel Corporation
 * Copyright © 2012-2013 Collabora, Ltd.
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * 
*/ struct wl_buffer; struct wl_callback; struct wl_compositor; struct wl_data_device; struct wl_data_device_manager; struct wl_data_offer; struct wl_data_source; struct wl_display; struct wl_keyboard; struct wl_output; struct wl_pointer; struct wl_region; struct wl_registry; struct wl_seat; struct wl_shell; struct wl_shell_surface; struct wl_shm; struct wl_shm_pool; struct wl_subcompositor; struct wl_subsurface; struct wl_surface; struct wl_touch; /** * @page page_iface_wl_display wl_display * @section page_iface_wl_display_desc Description * * The core global object. This is a special singleton object. It * is used for internal Wayland protocol features. * @section page_iface_wl_display_api API * See @ref iface_wl_display. */ /** * @defgroup iface_wl_display The wl_display interface * * The core global object. This is a special singleton object. It * is used for internal Wayland protocol features. */ extern const struct wl_interface wl_display_interface; /** * @page page_iface_wl_registry wl_registry * @section page_iface_wl_registry_desc Description * * The global registry object. The server has a number of global * objects that are available to all clients. These objects * typically represent an actual object in the server (for example, * an input device) or they are singleton objects that provide * extension functionality. * * When a client creates a registry object, the registry object * will emit a global event for each global currently in the * registry. Globals come and go as a result of device or * monitor hotplugs, reconfiguration or other events, and the * registry will send out global and global_remove events to * keep the client up to date with the changes. To mark the end * of the initial burst of events, the client can use the * wl_display.sync request immediately after calling * wl_display.get_registry. * * A client can bind to a global object by using the bind * request. This creates a client-side handle that lets the object * emit events to the client and lets the client invoke requests on * the object. * @section page_iface_wl_registry_api API * See @ref iface_wl_registry. */ /** * @defgroup iface_wl_registry The wl_registry interface * * The global registry object. The server has a number of global * objects that are available to all clients. These objects * typically represent an actual object in the server (for example, * an input device) or they are singleton objects that provide * extension functionality. * * When a client creates a registry object, the registry object * will emit a global event for each global currently in the * registry. Globals come and go as a result of device or * monitor hotplugs, reconfiguration or other events, and the * registry will send out global and global_remove events to * keep the client up to date with the changes. To mark the end * of the initial burst of events, the client can use the * wl_display.sync request immediately after calling * wl_display.get_registry. * * A client can bind to a global object by using the bind * request. This creates a client-side handle that lets the object * emit events to the client and lets the client invoke requests on * the object. */ extern const struct wl_interface wl_registry_interface; /** * @page page_iface_wl_callback wl_callback * @section page_iface_wl_callback_desc Description * * Clients can handle the 'done' event to get notified when * the related request is done. * @section page_iface_wl_callback_api API * See @ref iface_wl_callback. */ /** * @defgroup iface_wl_callback The wl_callback interface * * Clients can handle the 'done' event to get notified when * the related request is done. */ extern const struct wl_interface wl_callback_interface; /** * @page page_iface_wl_compositor wl_compositor * @section page_iface_wl_compositor_desc Description * * A compositor. This object is a singleton global. The * compositor is in charge of combining the contents of multiple * surfaces into one displayable output. * @section page_iface_wl_compositor_api API * See @ref iface_wl_compositor. */ /** * @defgroup iface_wl_compositor The wl_compositor interface * * A compositor. This object is a singleton global. The * compositor is in charge of combining the contents of multiple * surfaces into one displayable output. */ extern const struct wl_interface wl_compositor_interface; /** * @page page_iface_wl_shm_pool wl_shm_pool * @section page_iface_wl_shm_pool_desc Description * * The wl_shm_pool object encapsulates a piece of memory shared * between the compositor and client. Through the wl_shm_pool * object, the client can allocate shared memory wl_buffer objects. * All objects created through the same pool share the same * underlying mapped memory. Reusing the mapped memory avoids the * setup/teardown overhead and is useful when interactively resizing * a surface or for many small buffers. * @section page_iface_wl_shm_pool_api API * See @ref iface_wl_shm_pool. */ /** * @defgroup iface_wl_shm_pool The wl_shm_pool interface * * The wl_shm_pool object encapsulates a piece of memory shared * between the compositor and client. Through the wl_shm_pool * object, the client can allocate shared memory wl_buffer objects. * All objects created through the same pool share the same * underlying mapped memory. Reusing the mapped memory avoids the * setup/teardown overhead and is useful when interactively resizing * a surface or for many small buffers. */ extern const struct wl_interface wl_shm_pool_interface; /** * @page page_iface_wl_shm wl_shm * @section page_iface_wl_shm_desc Description * * A global singleton object that provides support for shared * memory. * * Clients can create wl_shm_pool objects using the create_pool * request. * * At connection setup time, the wl_shm object emits one or more * format events to inform clients about the valid pixel formats * that can be used for buffers. * @section page_iface_wl_shm_api API * See @ref iface_wl_shm. */ /** * @defgroup iface_wl_shm The wl_shm interface * * A global singleton object that provides support for shared * memory. * * Clients can create wl_shm_pool objects using the create_pool * request. * * At connection setup time, the wl_shm object emits one or more * format events to inform clients about the valid pixel formats * that can be used for buffers. */ extern const struct wl_interface wl_shm_interface; /** * @page page_iface_wl_buffer wl_buffer * @section page_iface_wl_buffer_desc Description * * A buffer provides the content for a wl_surface. Buffers are * created through factory interfaces such as wl_drm, wl_shm or * similar. It has a width and a height and can be attached to a * wl_surface, but the mechanism by which a client provides and * updates the contents is defined by the buffer factory interface. * @section page_iface_wl_buffer_api API * See @ref iface_wl_buffer. */ /** * @defgroup iface_wl_buffer The wl_buffer interface * * A buffer provides the content for a wl_surface. Buffers are * created through factory interfaces such as wl_drm, wl_shm or * similar. It has a width and a height and can be attached to a * wl_surface, but the mechanism by which a client provides and * updates the contents is defined by the buffer factory interface. */ extern const struct wl_interface wl_buffer_interface; /** * @page page_iface_wl_data_offer wl_data_offer * @section page_iface_wl_data_offer_desc Description * * A wl_data_offer represents a piece of data offered for transfer * by another client (the source client). It is used by the * copy-and-paste and drag-and-drop mechanisms. The offer * describes the different mime types that the data can be * converted to and provides the mechanism for transferring the * data directly from the source client. * @section page_iface_wl_data_offer_api API * See @ref iface_wl_data_offer. */ /** * @defgroup iface_wl_data_offer The wl_data_offer interface * * A wl_data_offer represents a piece of data offered for transfer * by another client (the source client). It is used by the * copy-and-paste and drag-and-drop mechanisms. The offer * describes the different mime types that the data can be * converted to and provides the mechanism for transferring the * data directly from the source client. */ extern const struct wl_interface wl_data_offer_interface; /** * @page page_iface_wl_data_source wl_data_source * @section page_iface_wl_data_source_desc Description * * The wl_data_source object is the source side of a wl_data_offer. * It is created by the source client in a data transfer and * provides a way to describe the offered data and a way to respond * to requests to transfer the data. * @section page_iface_wl_data_source_api API * See @ref iface_wl_data_source. */ /** * @defgroup iface_wl_data_source The wl_data_source interface * * The wl_data_source object is the source side of a wl_data_offer. * It is created by the source client in a data transfer and * provides a way to describe the offered data and a way to respond * to requests to transfer the data. */ extern const struct wl_interface wl_data_source_interface; /** * @page page_iface_wl_data_device wl_data_device * @section page_iface_wl_data_device_desc Description * * There is one wl_data_device per seat which can be obtained * from the global wl_data_device_manager singleton. * * A wl_data_device provides access to inter-client data transfer * mechanisms such as copy-and-paste and drag-and-drop. * @section page_iface_wl_data_device_api API * See @ref iface_wl_data_device. */ /** * @defgroup iface_wl_data_device The wl_data_device interface * * There is one wl_data_device per seat which can be obtained * from the global wl_data_device_manager singleton. * * A wl_data_device provides access to inter-client data transfer * mechanisms such as copy-and-paste and drag-and-drop. */ extern const struct wl_interface wl_data_device_interface; /** * @page page_iface_wl_data_device_manager wl_data_device_manager * @section page_iface_wl_data_device_manager_desc Description * * The wl_data_device_manager is a singleton global object that * provides access to inter-client data transfer mechanisms such as * copy-and-paste and drag-and-drop. These mechanisms are tied to * a wl_seat and this interface lets a client get a wl_data_device * corresponding to a wl_seat. * @section page_iface_wl_data_device_manager_api API * See @ref iface_wl_data_device_manager. */ /** * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface * * The wl_data_device_manager is a singleton global object that * provides access to inter-client data transfer mechanisms such as * copy-and-paste and drag-and-drop. These mechanisms are tied to * a wl_seat and this interface lets a client get a wl_data_device * corresponding to a wl_seat. */ extern const struct wl_interface wl_data_device_manager_interface; /** * @page page_iface_wl_shell wl_shell * @section page_iface_wl_shell_desc Description * * This interface is implemented by servers that provide * desktop-style user interfaces. * * It allows clients to associate a wl_shell_surface with * a basic surface. * @section page_iface_wl_shell_api API * See @ref iface_wl_shell. */ /** * @defgroup iface_wl_shell The wl_shell interface * * This interface is implemented by servers that provide * desktop-style user interfaces. * * It allows clients to associate a wl_shell_surface with * a basic surface. */ extern const struct wl_interface wl_shell_interface; /** * @page page_iface_wl_shell_surface wl_shell_surface * @section page_iface_wl_shell_surface_desc Description * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides requests to treat surfaces like toplevel, fullscreen * or popup windows, move, resize or maximize them, associate * metadata like title and class, etc. * * On the server side the object is automatically destroyed when * the related wl_surface is destroyed. On client side, * wl_shell_surface_destroy() must be called before destroying * the wl_surface object. * @section page_iface_wl_shell_surface_api API * See @ref iface_wl_shell_surface. */ /** * @defgroup iface_wl_shell_surface The wl_shell_surface interface * * An interface that may be implemented by a wl_surface, for * implementations that provide a desktop-style user interface. * * It provides requests to treat surfaces like toplevel, fullscreen * or popup windows, move, resize or maximize them, associate * metadata like title and class, etc. * * On the server side the object is automatically destroyed when * the related wl_surface is destroyed. On client side, * wl_shell_surface_destroy() must be called before destroying * the wl_surface object. */ extern const struct wl_interface wl_shell_surface_interface; /** * @page page_iface_wl_surface wl_surface * @section page_iface_wl_surface_desc Description * * A surface is a rectangular area that is displayed on the screen. * It has a location, size and pixel contents. * * The size of a surface (and relative positions on it) is described * in surface local coordinates, which may differ from the buffer * local coordinates of the pixel content, in case a buffer_transform * or a buffer_scale is used. * * Surfaces are also used for some special purposes, e.g. as * cursor images for pointers, drag icons, etc. * @section page_iface_wl_surface_api API * See @ref iface_wl_surface. */ /** * @defgroup iface_wl_surface The wl_surface interface * * A surface is a rectangular area that is displayed on the screen. * It has a location, size and pixel contents. * * The size of a surface (and relative positions on it) is described * in surface local coordinates, which may differ from the buffer * local coordinates of the pixel content, in case a buffer_transform * or a buffer_scale is used. * * Surfaces are also used for some special purposes, e.g. as * cursor images for pointers, drag icons, etc. */ extern const struct wl_interface wl_surface_interface; /** * @page page_iface_wl_seat wl_seat * @section page_iface_wl_seat_desc Description * * A seat is a group of keyboards, pointer and touch devices. This * object is published as a global during start up, or when such a * device is hot plugged. A seat typically has a pointer and * maintains a keyboard focus and a pointer focus. * @section page_iface_wl_seat_api API * See @ref iface_wl_seat. */ /** * @defgroup iface_wl_seat The wl_seat interface * * A seat is a group of keyboards, pointer and touch devices. This * object is published as a global during start up, or when such a * device is hot plugged. A seat typically has a pointer and * maintains a keyboard focus and a pointer focus. */ extern const struct wl_interface wl_seat_interface; /** * @page page_iface_wl_pointer wl_pointer * @section page_iface_wl_pointer_desc Description * * The wl_pointer interface represents one or more input devices, * such as mice, which control the pointer location and pointer_focus * of a seat. * * The wl_pointer interface generates motion, enter and leave * events for the surfaces that the pointer is located over, * and button and axis events for button presses, button releases * and scrolling. * @section page_iface_wl_pointer_api API * See @ref iface_wl_pointer. */ /** * @defgroup iface_wl_pointer The wl_pointer interface * * The wl_pointer interface represents one or more input devices, * such as mice, which control the pointer location and pointer_focus * of a seat. * * The wl_pointer interface generates motion, enter and leave * events for the surfaces that the pointer is located over, * and button and axis events for button presses, button releases * and scrolling. */ extern const struct wl_interface wl_pointer_interface; /** * @page page_iface_wl_keyboard wl_keyboard * @section page_iface_wl_keyboard_desc Description * * The wl_keyboard interface represents one or more keyboards * associated with a seat. * @section page_iface_wl_keyboard_api API * See @ref iface_wl_keyboard. */ /** * @defgroup iface_wl_keyboard The wl_keyboard interface * * The wl_keyboard interface represents one or more keyboards * associated with a seat. */ extern const struct wl_interface wl_keyboard_interface; /** * @page page_iface_wl_touch wl_touch * @section page_iface_wl_touch_desc Description * * The wl_touch interface represents a touchscreen * associated with a seat. * * Touch interactions can consist of one or more contacts. * For each contact, a series of events is generated, starting * with a down event, followed by zero or more motion events, * and ending with an up event. Events relating to the same * contact point can be identified by the ID of the sequence. * @section page_iface_wl_touch_api API * See @ref iface_wl_touch. */ /** * @defgroup iface_wl_touch The wl_touch interface * * The wl_touch interface represents a touchscreen * associated with a seat. * * Touch interactions can consist of one or more contacts. * For each contact, a series of events is generated, starting * with a down event, followed by zero or more motion events, * and ending with an up event. Events relating to the same * contact point can be identified by the ID of the sequence. */ extern const struct wl_interface wl_touch_interface; /** * @page page_iface_wl_output wl_output * @section page_iface_wl_output_desc Description * * An output describes part of the compositor geometry. The * compositor works in the 'compositor coordinate system' and an * output corresponds to rectangular area in that space that is * actually visible. This typically corresponds to a monitor that * displays part of the compositor space. This object is published * as global during start up, or when a monitor is hotplugged. * @section page_iface_wl_output_api API * See @ref iface_wl_output. */ /** * @defgroup iface_wl_output The wl_output interface * * An output describes part of the compositor geometry. The * compositor works in the 'compositor coordinate system' and an * output corresponds to rectangular area in that space that is * actually visible. This typically corresponds to a monitor that * displays part of the compositor space. This object is published * as global during start up, or when a monitor is hotplugged. */ extern const struct wl_interface wl_output_interface; /** * @page page_iface_wl_region wl_region * @section page_iface_wl_region_desc Description * * A region object describes an area. * * Region objects are used to describe the opaque and input * regions of a surface. * @section page_iface_wl_region_api API * See @ref iface_wl_region. */ /** * @defgroup iface_wl_region The wl_region interface * * A region object describes an area. * * Region objects are used to describe the opaque and input * regions of a surface. */ extern const struct wl_interface wl_region_interface; /** * @page page_iface_wl_subcompositor wl_subcompositor * @section page_iface_wl_subcompositor_desc Description * * The global interface exposing sub-surface compositing capabilities. * A wl_surface, that has sub-surfaces associated, is called the * parent surface. Sub-surfaces can be arbitrarily nested and create * a tree of sub-surfaces. * * The root surface in a tree of sub-surfaces is the main * surface. The main surface cannot be a sub-surface, because * sub-surfaces must always have a parent. * * A main surface with its sub-surfaces forms a (compound) window. * For window management purposes, this set of wl_surface objects is * to be considered as a single window, and it should also behave as * such. * * The aim of sub-surfaces is to offload some of the compositing work * within a window from clients to the compositor. A prime example is * a video player with decorations and video in separate wl_surface * objects. This should allow the compositor to pass YUV video buffer * processing to dedicated overlay hardware when possible. * @section page_iface_wl_subcompositor_api API * See @ref iface_wl_subcompositor. */ /** * @defgroup iface_wl_subcompositor The wl_subcompositor interface * * The global interface exposing sub-surface compositing capabilities. * A wl_surface, that has sub-surfaces associated, is called the * parent surface. Sub-surfaces can be arbitrarily nested and create * a tree of sub-surfaces. * * The root surface in a tree of sub-surfaces is the main * surface. The main surface cannot be a sub-surface, because * sub-surfaces must always have a parent. * * A main surface with its sub-surfaces forms a (compound) window. * For window management purposes, this set of wl_surface objects is * to be considered as a single window, and it should also behave as * such. * * The aim of sub-surfaces is to offload some of the compositing work * within a window from clients to the compositor. A prime example is * a video player with decorations and video in separate wl_surface * objects. This should allow the compositor to pass YUV video buffer * processing to dedicated overlay hardware when possible. */ extern const struct wl_interface wl_subcompositor_interface; /** * @page page_iface_wl_subsurface wl_subsurface * @section page_iface_wl_subsurface_desc Description * * An additional interface to a wl_surface object, which has been * made a sub-surface. A sub-surface has one parent surface. A * sub-surface's size and position are not limited to that of the parent. * Particularly, a sub-surface is not automatically clipped to its * parent's area. * * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied * and the parent surface is mapped. The order of which one happens * first is irrelevant. A sub-surface is hidden if the parent becomes * hidden, or if a NULL wl_buffer is applied. These rules apply * recursively through the tree of surfaces. * * The behaviour of wl_surface.commit request on a sub-surface * depends on the sub-surface's mode. The possible modes are * synchronized and desynchronized, see methods * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized * mode caches the wl_surface state to be applied when the parent's * state gets applied, and desynchronized mode applies the pending * wl_surface state directly. A sub-surface is initially in the * synchronized mode. * * Sub-surfaces have also other kind of state, which is managed by * wl_subsurface requests, as opposed to wl_surface requests. This * state includes the sub-surface position relative to the parent * surface (wl_subsurface.set_position), and the stacking order of * the parent and its sub-surfaces (wl_subsurface.place_above and * .place_below). This state is applied when the parent surface's * wl_surface state is applied, regardless of the sub-surface's mode. * As the exception, set_sync and set_desync are effective immediately. * * The main surface can be thought to be always in desynchronized mode, * since it does not have a parent in the sub-surfaces sense. * * Even if a sub-surface is in desynchronized mode, it will behave as * in synchronized mode, if its parent surface behaves as in * synchronized mode. This rule is applied recursively throughout the * tree of surfaces. This means, that one can set a sub-surface into * synchronized mode, and then assume that all its child and grand-child * sub-surfaces are synchronized, too, without explicitly setting them. * * If the wl_surface associated with the wl_subsurface is destroyed, the * wl_subsurface object becomes inert. Note, that destroying either object * takes effect immediately. If you need to synchronize the removal * of a sub-surface to the parent surface update, unmap the sub-surface * first by attaching a NULL wl_buffer, update parent, and then destroy * the sub-surface. * * If the parent wl_surface object is destroyed, the sub-surface is * unmapped. * @section page_iface_wl_subsurface_api API * See @ref iface_wl_subsurface. */ /** * @defgroup iface_wl_subsurface The wl_subsurface interface * * An additional interface to a wl_surface object, which has been * made a sub-surface. A sub-surface has one parent surface. A * sub-surface's size and position are not limited to that of the parent. * Particularly, a sub-surface is not automatically clipped to its * parent's area. * * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied * and the parent surface is mapped. The order of which one happens * first is irrelevant. A sub-surface is hidden if the parent becomes * hidden, or if a NULL wl_buffer is applied. These rules apply * recursively through the tree of surfaces. * * The behaviour of wl_surface.commit request on a sub-surface * depends on the sub-surface's mode. The possible modes are * synchronized and desynchronized, see methods * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized * mode caches the wl_surface state to be applied when the parent's * state gets applied, and desynchronized mode applies the pending * wl_surface state directly. A sub-surface is initially in the * synchronized mode. * * Sub-surfaces have also other kind of state, which is managed by * wl_subsurface requests, as opposed to wl_surface requests. This * state includes the sub-surface position relative to the parent * surface (wl_subsurface.set_position), and the stacking order of * the parent and its sub-surfaces (wl_subsurface.place_above and * .place_below). This state is applied when the parent surface's * wl_surface state is applied, regardless of the sub-surface's mode. * As the exception, set_sync and set_desync are effective immediately. * * The main surface can be thought to be always in desynchronized mode, * since it does not have a parent in the sub-surfaces sense. * * Even if a sub-surface is in desynchronized mode, it will behave as * in synchronized mode, if its parent surface behaves as in * synchronized mode. This rule is applied recursively throughout the * tree of surfaces. This means, that one can set a sub-surface into * synchronized mode, and then assume that all its child and grand-child * sub-surfaces are synchronized, too, without explicitly setting them. * * If the wl_surface associated with the wl_subsurface is destroyed, the * wl_subsurface object becomes inert. Note, that destroying either object * takes effect immediately. If you need to synchronize the removal * of a sub-surface to the parent surface update, unmap the sub-surface * first by attaching a NULL wl_buffer, update parent, and then destroy * the sub-surface. * * If the parent wl_surface object is destroyed, the sub-surface is * unmapped. */ extern const struct wl_interface wl_subsurface_interface; #ifndef WL_DISPLAY_ERROR_ENUM #define WL_DISPLAY_ERROR_ENUM /** * @ingroup iface_wl_display * global error values * * These errors are global and can be emitted in response to any * server request. */ enum wl_display_error { /** * server couldn't find object */ WL_DISPLAY_ERROR_INVALID_OBJECT = 0, /** * method doesn't exist on the specified interface */ WL_DISPLAY_ERROR_INVALID_METHOD = 1, /** * server is out of memory */ WL_DISPLAY_ERROR_NO_MEMORY = 2, }; #endif /* WL_DISPLAY_ERROR_ENUM */ /** * @ingroup iface_wl_display * @struct wl_display_listener */ struct wl_display_listener { /** * fatal error event * * The error event is sent out when a fatal (non-recoverable) * error has occurred. The object_id argument is the object where * the error occurred, most often in response to a request to that * object. The code identifies the error and is defined by the * object interface. As such, each interface defines its own set of * error codes. The message is an brief description of the error, * for (debugging) convenience. */ void (*error)(void *data, struct wl_display *wl_display, void *object_id, uint32_t code, const char *message); /** * acknowledge object ID deletion * * This event is used internally by the object ID management * logic. When a client deletes an object, the server will send * this event to acknowledge that it has seen the delete request. * When the client receive this event, it will know that it can * safely reuse the object ID. */ void (*delete_id)(void *data, struct wl_display *wl_display, uint32_t id); }; /** * @ingroup iface_wl_display */ static inline int wl_display_add_listener(struct wl_display *wl_display, const struct wl_display_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_display, (void (**)(void)) listener, data); } #define WL_DISPLAY_SYNC 0 #define WL_DISPLAY_GET_REGISTRY 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_ERROR_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_SYNC_SINCE_VERSION 1 /** * @ingroup iface_wl_display */ #define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1 /** @ingroup iface_wl_display */ static inline void wl_display_set_user_data(struct wl_display *wl_display, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data); } /** @ingroup iface_wl_display */ static inline void * wl_display_get_user_data(struct wl_display *wl_display) { return wl_proxy_get_user_data((struct wl_proxy *) wl_display); } static inline uint32_t wl_display_get_version(struct wl_display *wl_display) { return wl_proxy_get_version((struct wl_proxy *) wl_display); } /** * @ingroup iface_wl_display * * The sync request asks the server to emit the 'done' event * on the returned wl_callback object. Since requests are * handled in-order and events are delivered in-order, this can * be used as a barrier to ensure all previous requests and the * resulting events have been handled. * * The object returned by this request will be destroyed by the * compositor after the callback is fired and as such the client must not * attempt to use it after that point. * * The callback_data passed in the callback is the event serial. */ static inline struct wl_callback * wl_display_sync(struct wl_display *wl_display) { struct wl_proxy *callback; callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display, WL_DISPLAY_SYNC, &wl_callback_interface, NULL); return (struct wl_callback *) callback; } /** * @ingroup iface_wl_display * * This request creates a registry object that allows the client * to list and bind the global objects available from the * compositor. */ static inline struct wl_registry * wl_display_get_registry(struct wl_display *wl_display) { struct wl_proxy *registry; registry = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display, WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL); return (struct wl_registry *) registry; } /** * @ingroup iface_wl_registry * @struct wl_registry_listener */ struct wl_registry_listener { /** * announce global object * * Notify the client of global objects. * * The event notifies the client that a global object with the * given name is now available, and it implements the given version * of the given interface. */ void (*global)(void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version); /** * announce removal of global object * * Notify the client of removed global objects. * * This event notifies the client that the global identified by * name is no longer available. If the client bound to the global * using the bind request, the client should now destroy that * object. * * The object remains valid and requests to the object will be * ignored until the client destroys it, to avoid races between the * global going away and a client sending a request to it. */ void (*global_remove)(void *data, struct wl_registry *wl_registry, uint32_t name); }; /** * @ingroup iface_wl_registry */ static inline int wl_registry_add_listener(struct wl_registry *wl_registry, const struct wl_registry_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_registry, (void (**)(void)) listener, data); } #define WL_REGISTRY_BIND 0 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_GLOBAL_SINCE_VERSION 1 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_registry */ #define WL_REGISTRY_BIND_SINCE_VERSION 1 /** @ingroup iface_wl_registry */ static inline void wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data); } /** @ingroup iface_wl_registry */ static inline void * wl_registry_get_user_data(struct wl_registry *wl_registry) { return wl_proxy_get_user_data((struct wl_proxy *) wl_registry); } static inline uint32_t wl_registry_get_version(struct wl_registry *wl_registry) { return wl_proxy_get_version((struct wl_proxy *) wl_registry); } /** @ingroup iface_wl_registry */ static inline void wl_registry_destroy(struct wl_registry *wl_registry) { wl_proxy_destroy((struct wl_proxy *) wl_registry); } /** * @ingroup iface_wl_registry * * Binds a new, client-created object to the server using the * specified name as the identifier. */ static inline void * wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version) { struct wl_proxy *id; id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry, WL_REGISTRY_BIND, interface, version, name, interface->name, version, NULL); return (void *) id; } /** * @ingroup iface_wl_callback * @struct wl_callback_listener */ struct wl_callback_listener { /** * done event * * Notify the client when the related request is done. * @param callback_data request-specific data for the wl_callback */ void (*done)(void *data, struct wl_callback *wl_callback, uint32_t callback_data); }; /** * @ingroup iface_wl_callback */ static inline int wl_callback_add_listener(struct wl_callback *wl_callback, const struct wl_callback_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_callback, (void (**)(void)) listener, data); } /** * @ingroup iface_wl_callback */ #define WL_CALLBACK_DONE_SINCE_VERSION 1 /** @ingroup iface_wl_callback */ static inline void wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data); } /** @ingroup iface_wl_callback */ static inline void * wl_callback_get_user_data(struct wl_callback *wl_callback) { return wl_proxy_get_user_data((struct wl_proxy *) wl_callback); } static inline uint32_t wl_callback_get_version(struct wl_callback *wl_callback) { return wl_proxy_get_version((struct wl_proxy *) wl_callback); } /** @ingroup iface_wl_callback */ static inline void wl_callback_destroy(struct wl_callback *wl_callback) { wl_proxy_destroy((struct wl_proxy *) wl_callback); } #define WL_COMPOSITOR_CREATE_SURFACE 0 #define WL_COMPOSITOR_CREATE_REGION 1 /** * @ingroup iface_wl_compositor */ #define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1 /** * @ingroup iface_wl_compositor */ #define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1 /** @ingroup iface_wl_compositor */ static inline void wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data); } /** @ingroup iface_wl_compositor */ static inline void * wl_compositor_get_user_data(struct wl_compositor *wl_compositor) { return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor); } static inline uint32_t wl_compositor_get_version(struct wl_compositor *wl_compositor) { return wl_proxy_get_version((struct wl_proxy *) wl_compositor); } /** @ingroup iface_wl_compositor */ static inline void wl_compositor_destroy(struct wl_compositor *wl_compositor) { wl_proxy_destroy((struct wl_proxy *) wl_compositor); } /** * @ingroup iface_wl_compositor * * Ask the compositor to create a new surface. */ static inline struct wl_surface * wl_compositor_create_surface(struct wl_compositor *wl_compositor) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor, WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, NULL); return (struct wl_surface *) id; } /** * @ingroup iface_wl_compositor * * Ask the compositor to create a new region. */ static inline struct wl_region * wl_compositor_create_region(struct wl_compositor *wl_compositor) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor, WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL); return (struct wl_region *) id; } #define WL_SHM_POOL_CREATE_BUFFER 0 #define WL_SHM_POOL_DESTROY 1 #define WL_SHM_POOL_RESIZE 2 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_shm_pool */ #define WL_SHM_POOL_RESIZE_SINCE_VERSION 1 /** @ingroup iface_wl_shm_pool */ static inline void wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data); } /** @ingroup iface_wl_shm_pool */ static inline void * wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool); } static inline uint32_t wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool) { return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool); } /** * @ingroup iface_wl_shm_pool * * Create a wl_buffer object from the pool. * * The buffer is created offset bytes into the pool and has * width and height as specified. The stride arguments specifies * the number of bytes from beginning of one row to the beginning * of the next. The format is the pixel format of the buffer and * must be one of those advertised through the wl_shm.format event. * * A buffer will keep a reference to the pool it was created from * so it is valid to destroy the pool immediately after creating * a buffer from it. */ static inline struct wl_buffer * wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format); return (struct wl_buffer *) id; } /** * @ingroup iface_wl_shm_pool * * Destroy the shared memory pool. * * The mmapped memory will be released when all * buffers that have been created from this pool * are gone. */ static inline void wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool) { wl_proxy_marshal((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_shm_pool); } /** * @ingroup iface_wl_shm_pool * * This request will cause the server to remap the backing memory * for the pool from the file descriptor passed when the pool was * created, but using the new size. This request can only be * used to make the pool bigger. */ static inline void wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size) { wl_proxy_marshal((struct wl_proxy *) wl_shm_pool, WL_SHM_POOL_RESIZE, size); } #ifndef WL_SHM_ERROR_ENUM #define WL_SHM_ERROR_ENUM /** * @ingroup iface_wl_shm * wl_shm error values * * These errors can be emitted in response to wl_shm requests. */ enum wl_shm_error { /** * buffer format is not known */ WL_SHM_ERROR_INVALID_FORMAT = 0, /** * invalid size or stride during pool or buffer creation */ WL_SHM_ERROR_INVALID_STRIDE = 1, /** * mmapping the file descriptor failed */ WL_SHM_ERROR_INVALID_FD = 2, }; #endif /* WL_SHM_ERROR_ENUM */ #ifndef WL_SHM_FORMAT_ENUM #define WL_SHM_FORMAT_ENUM /** * @ingroup iface_wl_shm * pixel formats * * This describes the memory layout of an individual pixel. * * All renderers should support argb8888 and xrgb8888 but any other * formats are optional and may not be supported by the particular * renderer in use. */ enum wl_shm_format { /** * 32-bit ARGB format */ WL_SHM_FORMAT_ARGB8888 = 0, /** * 32-bit RGB format */ WL_SHM_FORMAT_XRGB8888 = 1, WL_SHM_FORMAT_C8 = 0x20203843, WL_SHM_FORMAT_RGB332 = 0x38424752, WL_SHM_FORMAT_BGR233 = 0x38524742, WL_SHM_FORMAT_XRGB4444 = 0x32315258, WL_SHM_FORMAT_XBGR4444 = 0x32314258, WL_SHM_FORMAT_RGBX4444 = 0x32315852, WL_SHM_FORMAT_BGRX4444 = 0x32315842, WL_SHM_FORMAT_ARGB4444 = 0x32315241, WL_SHM_FORMAT_ABGR4444 = 0x32314241, WL_SHM_FORMAT_RGBA4444 = 0x32314152, WL_SHM_FORMAT_BGRA4444 = 0x32314142, WL_SHM_FORMAT_XRGB1555 = 0x35315258, WL_SHM_FORMAT_XBGR1555 = 0x35314258, WL_SHM_FORMAT_RGBX5551 = 0x35315852, WL_SHM_FORMAT_BGRX5551 = 0x35315842, WL_SHM_FORMAT_ARGB1555 = 0x35315241, WL_SHM_FORMAT_ABGR1555 = 0x35314241, WL_SHM_FORMAT_RGBA5551 = 0x35314152, WL_SHM_FORMAT_BGRA5551 = 0x35314142, WL_SHM_FORMAT_RGB565 = 0x36314752, WL_SHM_FORMAT_BGR565 = 0x36314742, WL_SHM_FORMAT_RGB888 = 0x34324752, WL_SHM_FORMAT_BGR888 = 0x34324742, WL_SHM_FORMAT_XBGR8888 = 0x34324258, WL_SHM_FORMAT_RGBX8888 = 0x34325852, WL_SHM_FORMAT_BGRX8888 = 0x34325842, WL_SHM_FORMAT_ABGR8888 = 0x34324241, WL_SHM_FORMAT_RGBA8888 = 0x34324152, WL_SHM_FORMAT_BGRA8888 = 0x34324142, WL_SHM_FORMAT_XRGB2101010 = 0x30335258, WL_SHM_FORMAT_XBGR2101010 = 0x30334258, WL_SHM_FORMAT_RGBX1010102 = 0x30335852, WL_SHM_FORMAT_BGRX1010102 = 0x30335842, WL_SHM_FORMAT_ARGB2101010 = 0x30335241, WL_SHM_FORMAT_ABGR2101010 = 0x30334241, WL_SHM_FORMAT_RGBA1010102 = 0x30334152, WL_SHM_FORMAT_BGRA1010102 = 0x30334142, WL_SHM_FORMAT_YUYV = 0x56595559, WL_SHM_FORMAT_YVYU = 0x55595659, WL_SHM_FORMAT_UYVY = 0x59565955, WL_SHM_FORMAT_VYUY = 0x59555956, WL_SHM_FORMAT_AYUV = 0x56555941, WL_SHM_FORMAT_NV12 = 0x3231564e, WL_SHM_FORMAT_NV21 = 0x3132564e, WL_SHM_FORMAT_NV16 = 0x3631564e, WL_SHM_FORMAT_NV61 = 0x3136564e, WL_SHM_FORMAT_YUV410 = 0x39565559, WL_SHM_FORMAT_YVU410 = 0x39555659, WL_SHM_FORMAT_YUV411 = 0x31315559, WL_SHM_FORMAT_YVU411 = 0x31315659, WL_SHM_FORMAT_YUV420 = 0x32315559, WL_SHM_FORMAT_YVU420 = 0x32315659, WL_SHM_FORMAT_YUV422 = 0x36315559, WL_SHM_FORMAT_YVU422 = 0x36315659, WL_SHM_FORMAT_YUV444 = 0x34325559, WL_SHM_FORMAT_YVU444 = 0x34325659, }; #endif /* WL_SHM_FORMAT_ENUM */ /** * @ingroup iface_wl_shm * @struct wl_shm_listener */ struct wl_shm_listener { /** * pixel format description * * Informs the client about a valid pixel format that can be used * for buffers. Known formats include argb8888 and xrgb8888. */ void (*format)(void *data, struct wl_shm *wl_shm, uint32_t format); }; /** * @ingroup iface_wl_shm */ static inline int wl_shm_add_listener(struct wl_shm *wl_shm, const struct wl_shm_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_shm, (void (**)(void)) listener, data); } #define WL_SHM_CREATE_POOL 0 /** * @ingroup iface_wl_shm */ #define WL_SHM_FORMAT_SINCE_VERSION 1 /** * @ingroup iface_wl_shm */ #define WL_SHM_CREATE_POOL_SINCE_VERSION 1 /** @ingroup iface_wl_shm */ static inline void wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data); } /** @ingroup iface_wl_shm */ static inline void * wl_shm_get_user_data(struct wl_shm *wl_shm) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shm); } static inline uint32_t wl_shm_get_version(struct wl_shm *wl_shm) { return wl_proxy_get_version((struct wl_proxy *) wl_shm); } /** @ingroup iface_wl_shm */ static inline void wl_shm_destroy(struct wl_shm *wl_shm) { wl_proxy_destroy((struct wl_proxy *) wl_shm); } /** * @ingroup iface_wl_shm * * Create a new wl_shm_pool object. * * The pool can be used to create shared memory based buffer * objects. The server will mmap size bytes of the passed file * descriptor, to use as backing memory for the pool. */ static inline struct wl_shm_pool * wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm, WL_SHM_CREATE_POOL, &wl_shm_pool_interface, NULL, fd, size); return (struct wl_shm_pool *) id; } /** * @ingroup iface_wl_buffer * @struct wl_buffer_listener */ struct wl_buffer_listener { /** * compositor releases buffer * * Sent when this wl_buffer is no longer used by the compositor. * The client is now free to re-use or destroy this buffer and its * backing storage. * * If a client receives a release event before the frame callback * requested in the same wl_surface.commit that attaches this * wl_buffer to a surface, then the client is immediately free to * re-use the buffer and its backing storage, and does not need a * second buffer for the next surface content update. Typically * this is possible, when the compositor maintains a copy of the * wl_surface contents, e.g. as a GL texture. This is an important * optimization for GL(ES) compositors with wl_shm clients. */ void (*release)(void *data, struct wl_buffer *wl_buffer); }; /** * @ingroup iface_wl_buffer */ static inline int wl_buffer_add_listener(struct wl_buffer *wl_buffer, const struct wl_buffer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_buffer, (void (**)(void)) listener, data); } #define WL_BUFFER_DESTROY 0 /** * @ingroup iface_wl_buffer */ #define WL_BUFFER_RELEASE_SINCE_VERSION 1 /** * @ingroup iface_wl_buffer */ #define WL_BUFFER_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_buffer */ static inline void wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data); } /** @ingroup iface_wl_buffer */ static inline void * wl_buffer_get_user_data(struct wl_buffer *wl_buffer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer); } static inline uint32_t wl_buffer_get_version(struct wl_buffer *wl_buffer) { return wl_proxy_get_version((struct wl_proxy *) wl_buffer); } /** * @ingroup iface_wl_buffer * * Destroy a buffer. If and how you need to release the backing * storage is defined by the buffer factory interface. * * For possible side-effects to a surface, see wl_surface.attach. */ static inline void wl_buffer_destroy(struct wl_buffer *wl_buffer) { wl_proxy_marshal((struct wl_proxy *) wl_buffer, WL_BUFFER_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_buffer); } /** * @ingroup iface_wl_data_offer * @struct wl_data_offer_listener */ struct wl_data_offer_listener { /** * advertise offered mime type * * Sent immediately after creating the wl_data_offer object. One * event per offered mime type. */ void (*offer)(void *data, struct wl_data_offer *wl_data_offer, const char *mime_type); }; /** * @ingroup iface_wl_data_offer */ static inline int wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer, const struct wl_data_offer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer, (void (**)(void)) listener, data); } #define WL_DATA_OFFER_ACCEPT 0 #define WL_DATA_OFFER_RECEIVE 1 #define WL_DATA_OFFER_DESTROY 2 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_offer */ #define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_data_offer */ static inline void wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data); } /** @ingroup iface_wl_data_offer */ static inline void * wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer); } static inline uint32_t wl_data_offer_get_version(struct wl_data_offer *wl_data_offer) { return wl_proxy_get_version((struct wl_proxy *) wl_data_offer); } /** * @ingroup iface_wl_data_offer * * Indicate that the client can accept the given mime type, or * NULL for not accepted. * * Used for feedback during drag-and-drop. */ static inline void wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_ACCEPT, serial, mime_type); } /** * @ingroup iface_wl_data_offer * * To transfer the offered data, the client issues this request * and indicates the mime type it wants to receive. The transfer * happens through the passed file descriptor (typically created * with the pipe system call). The source client writes the data * in the mime type representation requested and then closes the * file descriptor. * * The receiving client reads from the read end of the pipe until * EOF and the closes its end, at which point the transfer is * complete. */ static inline void wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_RECEIVE, mime_type, fd); } /** * @ingroup iface_wl_data_offer * * Destroy the data offer. */ static inline void wl_data_offer_destroy(struct wl_data_offer *wl_data_offer) { wl_proxy_marshal((struct wl_proxy *) wl_data_offer, WL_DATA_OFFER_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_data_offer); } /** * @ingroup iface_wl_data_source * @struct wl_data_source_listener */ struct wl_data_source_listener { /** * a target accepts an offered mime type * * Sent when a target accepts pointer_focus or motion events. If * a target does not accept any of the offered types, type is NULL. * * Used for feedback during drag-and-drop. */ void (*target)(void *data, struct wl_data_source *wl_data_source, const char *mime_type); /** * send the data * * Request for data from the client. Send the data as the * specified mime type over the passed file descriptor, then close * it. */ void (*send)(void *data, struct wl_data_source *wl_data_source, const char *mime_type, int32_t fd); /** * selection was cancelled * * This data source has been replaced by another data source. The * client should clean up and destroy this data source. */ void (*cancelled)(void *data, struct wl_data_source *wl_data_source); }; /** * @ingroup iface_wl_data_source */ static inline int wl_data_source_add_listener(struct wl_data_source *wl_data_source, const struct wl_data_source_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_source, (void (**)(void)) listener, data); } #define WL_DATA_SOURCE_OFFER 0 #define WL_DATA_SOURCE_DESTROY 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_source */ #define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1 /** @ingroup iface_wl_data_source */ static inline void wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data); } /** @ingroup iface_wl_data_source */ static inline void * wl_data_source_get_user_data(struct wl_data_source *wl_data_source) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source); } static inline uint32_t wl_data_source_get_version(struct wl_data_source *wl_data_source) { return wl_proxy_get_version((struct wl_proxy *) wl_data_source); } /** * @ingroup iface_wl_data_source * * This request adds a mime type to the set of mime types * advertised to targets. Can be called several times to offer * multiple types. */ static inline void wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type) { wl_proxy_marshal((struct wl_proxy *) wl_data_source, WL_DATA_SOURCE_OFFER, mime_type); } /** * @ingroup iface_wl_data_source * * Destroy the data source. */ static inline void wl_data_source_destroy(struct wl_data_source *wl_data_source) { wl_proxy_marshal((struct wl_proxy *) wl_data_source, WL_DATA_SOURCE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_data_source); } /** * @ingroup iface_wl_data_device * @struct wl_data_device_listener */ struct wl_data_device_listener { /** * introduce a new wl_data_offer * * The data_offer event introduces a new wl_data_offer object, * which will subsequently be used in either the data_device.enter * event (for drag-and-drop) or the data_device.selection event * (for selections). Immediately following the * data_device_data_offer event, the new data_offer object will * send out data_offer.offer events to describe the mime types it * offers. */ void (*data_offer)(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id); /** * initiate drag-and-drop session * * This event is sent when an active drag-and-drop pointer enters * a surface owned by the client. The position of the pointer at * enter time is provided by the x and y arguments, in surface * local coordinates. */ void (*enter)(void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id); /** * end drag-and-drop session * * This event is sent when the drag-and-drop pointer leaves the * surface and the session ends. The client must destroy the * wl_data_offer introduced at enter time at this point. */ void (*leave)(void *data, struct wl_data_device *wl_data_device); /** * drag-and-drop session motion * * This event is sent when the drag-and-drop pointer moves within * the currently focused surface. The new position of the pointer * is provided by the x and y arguments, in surface local * coordinates. * @param time timestamp with millisecond granularity */ void (*motion)(void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y); /** * end drag-and-drag session successfully * * The event is sent when a drag-and-drop operation is ended * because the implicit grab is removed. */ void (*drop)(void *data, struct wl_data_device *wl_data_device); /** * advertise new selection * * The selection event is sent out to notify the client of a new * wl_data_offer for the selection for this device. The * data_device.data_offer and the data_offer.offer events are sent * out immediately before this event to introduce the data offer * object. The selection event is sent to a client immediately * before receiving keyboard focus and when a new selection is set * while the client has keyboard focus. The data_offer is valid * until a new data_offer or NULL is received or until the client * loses keyboard focus. */ void (*selection)(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *id); }; /** * @ingroup iface_wl_data_device */ static inline int wl_data_device_add_listener(struct wl_data_device *wl_data_device, const struct wl_data_device_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_data_device, (void (**)(void)) listener, data); } #define WL_DATA_DEVICE_START_DRAG 0 #define WL_DATA_DEVICE_SET_SELECTION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_DROP_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device */ #define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1 /** @ingroup iface_wl_data_device */ static inline void wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data); } /** @ingroup iface_wl_data_device */ static inline void * wl_data_device_get_user_data(struct wl_data_device *wl_data_device) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device); } static inline uint32_t wl_data_device_get_version(struct wl_data_device *wl_data_device) { return wl_proxy_get_version((struct wl_proxy *) wl_data_device); } /** @ingroup iface_wl_data_device */ static inline void wl_data_device_destroy(struct wl_data_device *wl_data_device) { wl_proxy_destroy((struct wl_proxy *) wl_data_device); } /** * @ingroup iface_wl_data_device * * This request asks the compositor to start a drag-and-drop * operation on behalf of the client. * * The source argument is the data source that provides the data * for the eventual data transfer. If source is NULL, enter, leave * and motion events are sent only to the client that initiated the * drag and the client is expected to handle the data passing * internally. * * The origin surface is the surface where the drag originates and * the client must have an active implicit grab that matches the * serial. * * The icon surface is an optional (can be NULL) surface that * provides an icon to be moved around with the cursor. Initially, * the top-left corner of the icon surface is placed at the cursor * hotspot, but subsequent wl_surface.attach request can move the * relative position. Attach requests must be confirmed with * wl_surface.commit as usual. * * The current and pending input regions of the icon wl_surface are * cleared, and wl_surface.set_input_region is ignored until the * wl_surface is no longer used as the icon surface. When the use * as an icon ends, the current and pending input regions become * undefined, and the wl_surface is unmapped. */ static inline void wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_data_device, WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial); } /** * @ingroup iface_wl_data_device * * This request asks the compositor to set the selection * to the data from the source on behalf of the client. * * To unset the selection, set the source to NULL. */ static inline void wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_data_device, WL_DATA_DEVICE_SET_SELECTION, source, serial); } #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0 #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1 /** * @ingroup iface_wl_data_device_manager */ #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1 /** * @ingroup iface_wl_data_device_manager */ #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1 /** @ingroup iface_wl_data_device_manager */ static inline void wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data); } /** @ingroup iface_wl_data_device_manager */ static inline void * wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager) { return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager); } static inline uint32_t wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager) { return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager); } /** @ingroup iface_wl_data_device_manager */ static inline void wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager) { wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager); } /** * @ingroup iface_wl_data_device_manager * * Create a new data source. */ static inline struct wl_data_source * wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager, WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, NULL); return (struct wl_data_source *) id; } /** * @ingroup iface_wl_data_device_manager * * Create a new data device for a given seat. */ static inline struct wl_data_device * wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager, WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, NULL, seat); return (struct wl_data_device *) id; } #define WL_SHELL_GET_SHELL_SURFACE 0 /** * @ingroup iface_wl_shell */ #define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1 /** @ingroup iface_wl_shell */ static inline void wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data); } /** @ingroup iface_wl_shell */ static inline void * wl_shell_get_user_data(struct wl_shell *wl_shell) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shell); } static inline uint32_t wl_shell_get_version(struct wl_shell *wl_shell) { return wl_proxy_get_version((struct wl_proxy *) wl_shell); } /** @ingroup iface_wl_shell */ static inline void wl_shell_destroy(struct wl_shell *wl_shell) { wl_proxy_destroy((struct wl_proxy *) wl_shell); } /** * @ingroup iface_wl_shell * * Create a shell surface for an existing surface. * * Only one shell surface can be associated with a given surface. */ static inline struct wl_shell_surface * wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shell, WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, NULL, surface); return (struct wl_shell_surface *) id; } #ifndef WL_SHELL_SURFACE_RESIZE_ENUM #define WL_SHELL_SURFACE_RESIZE_ENUM /** * @ingroup iface_wl_shell_surface * edge values for resizing * * These values are used to indicate which edge of a surface * is being dragged in a resize operation. The server may * use this information to adapt its behavior, e.g. choose * an appropriate cursor image. */ enum wl_shell_surface_resize { WL_SHELL_SURFACE_RESIZE_NONE = 0, WL_SHELL_SURFACE_RESIZE_TOP = 1, WL_SHELL_SURFACE_RESIZE_BOTTOM = 2, WL_SHELL_SURFACE_RESIZE_LEFT = 4, WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5, WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6, WL_SHELL_SURFACE_RESIZE_RIGHT = 8, WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9, WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10, }; #endif /* WL_SHELL_SURFACE_RESIZE_ENUM */ #ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM #define WL_SHELL_SURFACE_TRANSIENT_ENUM /** * @ingroup iface_wl_shell_surface * details of transient behaviour * * These flags specify details of the expected behaviour * of transient surfaces. Used in the set_transient request. */ enum wl_shell_surface_transient { /** * do not set keyboard focus */ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1, }; #endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */ #ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM #define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM /** * @ingroup iface_wl_shell_surface * different method to set the surface fullscreen * * Hints to indicate to the compositor how to deal with a conflict * between the dimensions of the surface and the dimensions of the * output. The compositor is free to ignore this parameter. */ enum wl_shell_surface_fullscreen_method { /** * no preference, apply default policy */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0, /** * scale, preserve the surface's aspect ratio and center on output */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1, /** * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2, /** * no upscaling, center on output and add black borders to compensate size mismatch */ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3, }; #endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */ /** * @ingroup iface_wl_shell_surface * @struct wl_shell_surface_listener */ struct wl_shell_surface_listener { /** * ping client * * Ping a client to check if it is receiving events and sending * requests. A client is expected to reply with a pong request. */ void (*ping)(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial); /** * suggest resize * * The configure event asks the client to resize its surface. * * The size is a hint, in the sense that the client is free to * ignore it if it doesn't resize, pick a smaller size (to satisfy * aspect ratio or resize in steps of NxM pixels). * * The edges parameter provides a hint about how the surface was * resized. The client may use this information to decide how to * adjust its content to the new size (e.g. a scrolling area might * adjust its content position to leave the viewable content * unmoved). * * The client is free to dismiss all but the last configure event * it received. * * The width and height arguments specify the size of the window in * surface local coordinates. */ void (*configure)(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t edges, int32_t width, int32_t height); /** * popup interaction is done * * The popup_done event is sent out when a popup grab is broken, * that is, when the user clicks a surface that doesn't belong to * the client owning the popup surface. */ void (*popup_done)(void *data, struct wl_shell_surface *wl_shell_surface); }; /** * @ingroup iface_wl_shell_surface */ static inline int wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface, const struct wl_shell_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface, (void (**)(void)) listener, data); } #define WL_SHELL_SURFACE_PONG 0 #define WL_SHELL_SURFACE_MOVE 1 #define WL_SHELL_SURFACE_RESIZE 2 #define WL_SHELL_SURFACE_SET_TOPLEVEL 3 #define WL_SHELL_SURFACE_SET_TRANSIENT 4 #define WL_SHELL_SURFACE_SET_FULLSCREEN 5 #define WL_SHELL_SURFACE_SET_POPUP 6 #define WL_SHELL_SURFACE_SET_MAXIMIZED 7 #define WL_SHELL_SURFACE_SET_TITLE 8 #define WL_SHELL_SURFACE_SET_CLASS 9 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_PING_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1 /** * @ingroup iface_wl_shell_surface */ #define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1 /** @ingroup iface_wl_shell_surface */ static inline void wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data); } /** @ingroup iface_wl_shell_surface */ static inline void * wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface); } static inline uint32_t wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface) { return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface); } /** @ingroup iface_wl_shell_surface */ static inline void wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface) { wl_proxy_destroy((struct wl_proxy *) wl_shell_surface); } /** * @ingroup iface_wl_shell_surface * * A client must respond to a ping event with a pong request or * the client may be deemed unresponsive. */ static inline void wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_PONG, serial); } /** * @ingroup iface_wl_shell_surface * * Start a pointer-driven move of the surface. * * This request must be used in response to a button press event. * The server may ignore move requests depending on the state of * the surface (e.g. fullscreen or maximized). */ static inline void wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_MOVE, seat, serial); } /** * @ingroup iface_wl_shell_surface * * Start a pointer-driven resizing of the surface. * * This request must be used in response to a button press event. * The server may ignore resize requests depending on the state of * the surface (e.g. fullscreen or maximized). */ static inline void wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_RESIZE, seat, serial, edges); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a toplevel surface. * * A toplevel surface is not fullscreen, maximized or transient. */ static inline void wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TOPLEVEL); } /** * @ingroup iface_wl_shell_surface * * Map the surface relative to an existing surface. * * The x and y arguments specify the locations of the upper left * corner of the surface relative to the upper left corner of the * parent surface, in surface local coordinates. * * The flags argument controls details of the transient behaviour. */ static inline void wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TRANSIENT, parent, x, y, flags); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a fullscreen surface. * * If an output parameter is given then the surface will be made * fullscreen on that output. If the client does not specify the * output then the compositor will apply its policy - usually * choosing the output on which the surface has the biggest surface * area. * * The client may specify a method to resolve a size conflict * between the output size and the surface size - this is provided * through the method parameter. * * The framerate parameter is used only when the method is set * to "driver", to indicate the preferred framerate. A value of 0 * indicates that the app does not care about framerate. The * framerate is specified in mHz, that is framerate of 60000 is 60Hz. * * A method of "scale" or "driver" implies a scaling operation of * the surface, either via a direct scaling operation or a change of * the output mode. This will override any kind of output scaling, so * that mapping a surface with a buffer size equal to the mode can * fill the screen independent of buffer_scale. * * A method of "fill" means we don't scale up the buffer, however * any output scale is applied. This means that you may run into * an edge case where the application maps a buffer with the same * size of the output mode but buffer_scale 1 (thus making a * surface larger than the output). In this case it is allowed to * downscale the results to fit the screen. * * The compositor must reply to this request with a configure event * with the dimensions for the output on which the surface will * be made fullscreen. */ static inline void wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a popup. * * A popup surface is a transient surface with an added pointer * grab. * * An existing implicit grab will be changed to owner-events mode, * and the popup grab will continue after the implicit grab ends * (i.e. releasing the mouse button does not cause the popup to * be unmapped). * * The popup grab continues until the window is destroyed or a * mouse button is pressed in any other clients window. A click * in any of the clients surfaces is reported as normal, however, * clicks in other clients surfaces will be discarded and trigger * the callback. * * The x and y arguments specify the locations of the upper left * corner of the surface relative to the upper left corner of the * parent surface, in surface local coordinates. */ static inline void wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags); } /** * @ingroup iface_wl_shell_surface * * Map the surface as a maximized surface. * * If an output parameter is given then the surface will be * maximized on that output. If the client does not specify the * output then the compositor will apply its policy - usually * choosing the output on which the surface has the biggest surface * area. * * The compositor will reply with a configure event telling * the expected new surface size. The operation is completed * on the next buffer attach to this surface. * * A maximized surface typically fills the entire output it is * bound to, except for desktop element such as panels. This is * the main difference between a maximized shell surface and a * fullscreen shell surface. * * The details depend on the compositor implementation. */ static inline void wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_MAXIMIZED, output); } /** * @ingroup iface_wl_shell_surface * * Set a short title for the surface. * * This string may be used to identify the surface in a task bar, * window list, or other user interface elements provided by the * compositor. * * The string must be encoded in UTF-8. */ static inline void wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_TITLE, title); } /** * @ingroup iface_wl_shell_surface * * Set a class for the surface. * * The surface class identifies the general class of applications * to which the surface belongs. A common convention is to use the * file name (or the full path if it is a non-standard location) of * the application's .desktop file as the class. */ static inline void wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_) { wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, WL_SHELL_SURFACE_SET_CLASS, class_); } #ifndef WL_SURFACE_ERROR_ENUM #define WL_SURFACE_ERROR_ENUM /** * @ingroup iface_wl_surface * wl_surface error values * * These errors can be emitted in response to wl_surface requests. */ enum wl_surface_error { /** * buffer scale value is invalid */ WL_SURFACE_ERROR_INVALID_SCALE = 0, /** * buffer transform value is invalid */ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1, }; #endif /* WL_SURFACE_ERROR_ENUM */ /** * @ingroup iface_wl_surface * @struct wl_surface_listener */ struct wl_surface_listener { /** * surface enters an output * * This is emitted whenever a surface's creation, movement, or * resizing results in some part of it being within the scanout * region of an output. * * Note that a surface may be overlapping with zero or more * outputs. */ void (*enter)(void *data, struct wl_surface *wl_surface, struct wl_output *output); /** * surface leaves an output * * This is emitted whenever a surface's creation, movement, or * resizing results in it no longer having any part of it within * the scanout region of an output. */ void (*leave)(void *data, struct wl_surface *wl_surface, struct wl_output *output); }; /** * @ingroup iface_wl_surface */ static inline int wl_surface_add_listener(struct wl_surface *wl_surface, const struct wl_surface_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_surface, (void (**)(void)) listener, data); } #define WL_SURFACE_DESTROY 0 #define WL_SURFACE_ATTACH 1 #define WL_SURFACE_DAMAGE 2 #define WL_SURFACE_FRAME 3 #define WL_SURFACE_SET_OPAQUE_REGION 4 #define WL_SURFACE_SET_INPUT_REGION 5 #define WL_SURFACE_COMMIT 6 #define WL_SURFACE_SET_BUFFER_TRANSFORM 7 #define WL_SURFACE_SET_BUFFER_SCALE 8 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_ATTACH_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_DAMAGE_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_FRAME_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_COMMIT_SINCE_VERSION 1 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2 /** * @ingroup iface_wl_surface */ #define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3 /** @ingroup iface_wl_surface */ static inline void wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data); } /** @ingroup iface_wl_surface */ static inline void * wl_surface_get_user_data(struct wl_surface *wl_surface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_surface); } static inline uint32_t wl_surface_get_version(struct wl_surface *wl_surface) { return wl_proxy_get_version((struct wl_proxy *) wl_surface); } /** * @ingroup iface_wl_surface * * Deletes the surface and invalidates its object ID. */ static inline void wl_surface_destroy(struct wl_surface *wl_surface) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_surface); } /** * @ingroup iface_wl_surface * * Set a buffer as the content of this surface. * * The new size of the surface is calculated based on the buffer * size transformed by the inverse buffer_transform and the * inverse buffer_scale. This means that the supplied buffer * must be an integer multiple of the buffer_scale. * * The x and y arguments specify the location of the new pending * buffer's upper left corner, relative to the current buffer's upper * left corner, in surface local coordinates. In other words, the * x and y, combined with the new surface size define in which * directions the surface's size changes. * * Surface contents are double-buffered state, see wl_surface.commit. * * The initial surface contents are void; there is no content. * wl_surface.attach assigns the given wl_buffer as the pending * wl_buffer. wl_surface.commit makes the pending wl_buffer the new * surface contents, and the size of the surface becomes the size * calculated from the wl_buffer, as described above. After commit, * there is no pending buffer until the next attach. * * Committing a pending wl_buffer allows the compositor to read the * pixels in the wl_buffer. The compositor may access the pixels at * any time after the wl_surface.commit request. When the compositor * will not access the pixels anymore, it will send the * wl_buffer.release event. Only after receiving wl_buffer.release, * the client may re-use the wl_buffer. A wl_buffer that has been * attached and then replaced by another attach instead of committed * will not receive a release event, and is not used by the * compositor. * * Destroying the wl_buffer after wl_buffer.release does not change * the surface contents. However, if the client destroys the * wl_buffer before receiving the wl_buffer.release event, the surface * contents become undefined immediately. * * If wl_surface.attach is sent with a NULL wl_buffer, the * following wl_surface.commit will remove the surface content. */ static inline void wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_ATTACH, buffer, x, y); } /** * @ingroup iface_wl_surface * * This request is used to describe the regions where the pending * buffer is different from the current surface contents, and where * the surface therefore needs to be repainted. The pending buffer * must be set by wl_surface.attach before sending damage. The * compositor ignores the parts of the damage that fall outside of * the surface. * * Damage is double-buffered state, see wl_surface.commit. * * The damage rectangle is specified in surface local coordinates. * * The initial value for pending damage is empty: no damage. * wl_surface.damage adds pending damage: the new pending damage * is the union of old pending damage and the given rectangle. * * wl_surface.commit assigns pending damage as the current damage, * and clears pending damage. The server will clear the current * damage as it repaints the surface. */ static inline void wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_DAMAGE, x, y, width, height); } /** * @ingroup iface_wl_surface * * Request a notification when it is a good time start drawing a new * frame, by creating a frame callback. This is useful for throttling * redrawing operations, and driving animations. * * When a client is animating on a wl_surface, it can use the 'frame' * request to get notified when it is a good time to draw and commit the * next frame of animation. If the client commits an update earlier than * that, it is likely that some updates will not make it to the display, * and the client is wasting resources by drawing too often. * * The frame request will take effect on the next wl_surface.commit. * The notification will only be posted for one frame unless * requested again. For a wl_surface, the notifications are posted in * the order the frame requests were committed. * * The server must send the notifications so that a client * will not send excessive updates, while still allowing * the highest possible update rate for clients that wait for the reply * before drawing again. The server should give some time for the client * to draw and commit after sending the frame callback events to let them * hit the next output refresh. * * A server should avoid signalling the frame callbacks if the * surface is not visible in any way, e.g. the surface is off-screen, * or completely obscured by other opaque surfaces. * * The object returned by this request will be destroyed by the * compositor after the callback is fired and as such the client must not * attempt to use it after that point. * * The callback_data passed in the callback is the current time, in * milliseconds, with an undefined base. */ static inline struct wl_callback * wl_surface_frame(struct wl_surface *wl_surface) { struct wl_proxy *callback; callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_surface, WL_SURFACE_FRAME, &wl_callback_interface, NULL); return (struct wl_callback *) callback; } /** * @ingroup iface_wl_surface * * This request sets the region of the surface that contains * opaque content. * * The opaque region is an optimization hint for the compositor * that lets it optimize out redrawing of content behind opaque * regions. Setting an opaque region is not required for correct * behaviour, but marking transparent content as opaque will result * in repaint artifacts. * * The opaque region is specified in surface local coordinates. * * The compositor ignores the parts of the opaque region that fall * outside of the surface. * * Opaque region is double-buffered state, see wl_surface.commit. * * wl_surface.set_opaque_region changes the pending opaque region. * wl_surface.commit copies the pending region to the current region. * Otherwise, the pending and current regions are never changed. * * The initial value for opaque region is empty. Setting the pending * opaque region has copy semantics, and the wl_region object can be * destroyed immediately. A NULL wl_region causes the pending opaque * region to be set to empty. */ static inline void wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_OPAQUE_REGION, region); } /** * @ingroup iface_wl_surface * * This request sets the region of the surface that can receive * pointer and touch events. * * Input events happening outside of this region will try the next * surface in the server surface stack. The compositor ignores the * parts of the input region that fall outside of the surface. * * The input region is specified in surface local coordinates. * * Input region is double-buffered state, see wl_surface.commit. * * wl_surface.set_input_region changes the pending input region. * wl_surface.commit copies the pending region to the current region. * Otherwise the pending and current regions are never changed, * except cursor and icon surfaces are special cases, see * wl_pointer.set_cursor and wl_data_device.start_drag. * * The initial value for input region is infinite. That means the * whole surface will accept input. Setting the pending input region * has copy semantics, and the wl_region object can be destroyed * immediately. A NULL wl_region causes the input region to be set * to infinite. */ static inline void wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_INPUT_REGION, region); } /** * @ingroup iface_wl_surface * * Surface state (input, opaque, and damage regions, attached buffers, * etc.) is double-buffered. Protocol requests modify the pending * state, as opposed to current state in use by the compositor. Commit * request atomically applies all pending state, replacing the current * state. After commit, the new pending state is as documented for each * related request. * * On commit, a pending wl_buffer is applied first, all other state * second. This means that all coordinates in double-buffered state are * relative to the new wl_buffer coming into use, except for * wl_surface.attach itself. If there is no pending wl_buffer, the * coordinates are relative to the current surface contents. * * All requests that need a commit to become effective are documented * to affect double-buffered state. * * Other interfaces may add further double-buffered surface state. */ static inline void wl_surface_commit(struct wl_surface *wl_surface) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_COMMIT); } /** * @ingroup iface_wl_surface * * This request sets an optional transformation on how the compositor * interprets the contents of the buffer attached to the surface. The * accepted values for the transform parameter are the values for * wl_output.transform. * * Buffer transform is double-buffered state, see wl_surface.commit. * * A newly created surface has its buffer transformation set to normal. * * wl_surface.set_buffer_transform changes the pending buffer * transformation. wl_surface.commit copies the pending buffer * transformation to the current one. Otherwise, the pending and current * values are never changed. * * The purpose of this request is to allow clients to render content * according to the output transform, thus permiting the compositor to * use certain optimizations even if the display is rotated. Using * hardware overlays and scanning out a client buffer for fullscreen * surfaces are examples of such optimizations. Those optimizations are * highly dependent on the compositor implementation, so the use of this * request should be considered on a case-by-case basis. * * Note that if the transform value includes 90 or 270 degree rotation, * the width of the buffer will become the surface height and the height * of the buffer will become the surface width. * * If transform is not one of the values from the * wl_output.transform enum the invalid_transform protocol error * is raised. */ static inline void wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_BUFFER_TRANSFORM, transform); } /** * @ingroup iface_wl_surface * * This request sets an optional scaling factor on how the compositor * interprets the contents of the buffer attached to the window. * * Buffer scale is double-buffered state, see wl_surface.commit. * * A newly created surface has its buffer scale set to 1. * * wl_surface.set_buffer_scale changes the pending buffer scale. * wl_surface.commit copies the pending buffer scale to the current one. * Otherwise, the pending and current values are never changed. * * The purpose of this request is to allow clients to supply higher * resolution buffer data for use on high resolution outputs. Its * intended that you pick the same buffer scale as the scale of the * output that the surface is displayed on.This means the compositor * can avoid scaling when rendering the surface on that output. * * Note that if the scale is larger than 1, then you have to attach * a buffer that is larger (by a factor of scale in each dimension) * than the desired surface size. * * If scale is not positive the invalid_scale protocol error is * raised. */ static inline void wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale) { wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_SET_BUFFER_SCALE, scale); } #ifndef WL_SEAT_CAPABILITY_ENUM #define WL_SEAT_CAPABILITY_ENUM /** * @ingroup iface_wl_seat * seat capability bitmask * * This is a bitmask of capabilities this seat has; if a member is * set, then it is present on the seat. */ enum wl_seat_capability { /** * The seat has pointer devices */ WL_SEAT_CAPABILITY_POINTER = 1, /** * The seat has one or more keyboards */ WL_SEAT_CAPABILITY_KEYBOARD = 2, /** * The seat has touch devices */ WL_SEAT_CAPABILITY_TOUCH = 4, }; #endif /* WL_SEAT_CAPABILITY_ENUM */ /** * @ingroup iface_wl_seat * @struct wl_seat_listener */ struct wl_seat_listener { /** * seat capabilities changed * * This is emitted whenever a seat gains or loses the pointer, * keyboard or touch capabilities. The argument is a capability * enum containing the complete set of capabilities this seat has. */ void (*capabilities)(void *data, struct wl_seat *wl_seat, uint32_t capabilities); /** * unique identifier for this seat * * In a multiseat configuration this can be used by the client to * help identify which physical devices the seat represents. Based * on the seat configuration used by the compositor. * @since 2 */ void (*name)(void *data, struct wl_seat *wl_seat, const char *name); }; /** * @ingroup iface_wl_seat */ static inline int wl_seat_add_listener(struct wl_seat *wl_seat, const struct wl_seat_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_seat, (void (**)(void)) listener, data); } #define WL_SEAT_GET_POINTER 0 #define WL_SEAT_GET_KEYBOARD 1 #define WL_SEAT_GET_TOUCH 2 /** * @ingroup iface_wl_seat */ #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_NAME_SINCE_VERSION 2 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_POINTER_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1 /** * @ingroup iface_wl_seat */ #define WL_SEAT_GET_TOUCH_SINCE_VERSION 1 /** @ingroup iface_wl_seat */ static inline void wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data); } /** @ingroup iface_wl_seat */ static inline void * wl_seat_get_user_data(struct wl_seat *wl_seat) { return wl_proxy_get_user_data((struct wl_proxy *) wl_seat); } static inline uint32_t wl_seat_get_version(struct wl_seat *wl_seat) { return wl_proxy_get_version((struct wl_proxy *) wl_seat); } /** @ingroup iface_wl_seat */ static inline void wl_seat_destroy(struct wl_seat *wl_seat) { wl_proxy_destroy((struct wl_proxy *) wl_seat); } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_pointer interface * for this seat. * * This request only takes effect if the seat has the pointer * capability. */ static inline struct wl_pointer * wl_seat_get_pointer(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_POINTER, &wl_pointer_interface, NULL); return (struct wl_pointer *) id; } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_keyboard interface * for this seat. * * This request only takes effect if the seat has the keyboard * capability. */ static inline struct wl_keyboard * wl_seat_get_keyboard(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, NULL); return (struct wl_keyboard *) id; } /** * @ingroup iface_wl_seat * * The ID provided will be initialized to the wl_touch interface * for this seat. * * This request only takes effect if the seat has the touch * capability. */ static inline struct wl_touch * wl_seat_get_touch(struct wl_seat *wl_seat) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL); return (struct wl_touch *) id; } #ifndef WL_POINTER_BUTTON_STATE_ENUM #define WL_POINTER_BUTTON_STATE_ENUM /** * @ingroup iface_wl_pointer * physical button state * * Describes the physical state of a button which provoked the button * event. */ enum wl_pointer_button_state { /** * The button is not pressed */ WL_POINTER_BUTTON_STATE_RELEASED = 0, /** * The button is pressed */ WL_POINTER_BUTTON_STATE_PRESSED = 1, }; #endif /* WL_POINTER_BUTTON_STATE_ENUM */ #ifndef WL_POINTER_AXIS_ENUM #define WL_POINTER_AXIS_ENUM /** * @ingroup iface_wl_pointer * axis types * * Describes the axis types of scroll events. */ enum wl_pointer_axis { WL_POINTER_AXIS_VERTICAL_SCROLL = 0, WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, }; #endif /* WL_POINTER_AXIS_ENUM */ /** * @ingroup iface_wl_pointer * @struct wl_pointer_listener */ struct wl_pointer_listener { /** * enter event * * Notification that this seat's pointer is focused on a certain * surface. * * When an seat's focus enters a surface, the pointer image is * undefined and a client should respond to this event by setting * an appropriate pointer image with the set_cursor request. * @param surface_x x coordinate in surface-relative coordinates * @param surface_y y coordinate in surface-relative coordinates */ void (*enter)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y); /** * leave event * * Notification that this seat's pointer is no longer focused on * a certain surface. * * The leave notification is sent before the enter notification for * the new focus. */ void (*leave)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface); /** * pointer motion event * * Notification of pointer location change. The arguments * surface_x and surface_y are the location relative to the focused * surface. * @param time timestamp with millisecond granularity * @param surface_x x coordinate in surface-relative coordinates * @param surface_y y coordinate in surface-relative coordinates */ void (*motion)(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y); /** * pointer button event * * Mouse button click and release notifications. * * The location of the click is given by the last motion or enter * event. The time argument is a timestamp with millisecond * granularity, with an undefined base. * @param time timestamp with millisecond granularity */ void (*button)(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state); /** * axis event * * Scroll and other axis notifications. * * For scroll events (vertical and horizontal scroll axes), the * value parameter is the length of a vector along the specified * axis in a coordinate space identical to those of motion events, * representing a relative movement along the specified axis. * * For devices that support movements non-parallel to axes multiple * axis events will be emitted. * * When applicable, for example for touch pads, the server can * choose to emit scroll events where the motion vector is * equivalent to a motion event vector. * * When applicable, clients can transform its view relative to the * scroll distance. * @param time timestamp with millisecond granularity */ void (*axis)(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value); }; /** * @ingroup iface_wl_pointer */ static inline int wl_pointer_add_listener(struct wl_pointer *wl_pointer, const struct wl_pointer_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_pointer, (void (**)(void)) listener, data); } #define WL_POINTER_SET_CURSOR 0 #define WL_POINTER_RELEASE 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_BUTTON_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_AXIS_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_SET_CURSOR_SINCE_VERSION 1 /** * @ingroup iface_wl_pointer */ #define WL_POINTER_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_pointer */ static inline void wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data); } /** @ingroup iface_wl_pointer */ static inline void * wl_pointer_get_user_data(struct wl_pointer *wl_pointer) { return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer); } static inline uint32_t wl_pointer_get_version(struct wl_pointer *wl_pointer) { return wl_proxy_get_version((struct wl_proxy *) wl_pointer); } /** @ingroup iface_wl_pointer */ static inline void wl_pointer_destroy(struct wl_pointer *wl_pointer) { wl_proxy_destroy((struct wl_proxy *) wl_pointer); } /** * @ingroup iface_wl_pointer * * Set the pointer surface, i.e., the surface that contains the * pointer image (cursor). This request only takes effect if the pointer * focus for this device is one of the requesting client's surfaces * or the surface parameter is the current pointer surface. If * there was a previous surface set with this request it is * replaced. If surface is NULL, the pointer image is hidden. * * The parameters hotspot_x and hotspot_y define the position of * the pointer surface relative to the pointer location. Its * top-left corner is always at (x, y) - (hotspot_x, hotspot_y), * where (x, y) are the coordinates of the pointer location, in surface * local coordinates. * * On surface.attach requests to the pointer surface, hotspot_x * and hotspot_y are decremented by the x and y parameters * passed to the request. Attach must be confirmed by * wl_surface.commit as usual. * * The hotspot can also be updated by passing the currently set * pointer surface to this request with new values for hotspot_x * and hotspot_y. * * The current and pending input regions of the wl_surface are * cleared, and wl_surface.set_input_region is ignored until the * wl_surface is no longer used as the cursor. When the use as a * cursor ends, the current and pending input regions become * undefined, and the wl_surface is unmapped. */ static inline void wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y) { wl_proxy_marshal((struct wl_proxy *) wl_pointer, WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y); } /** * @ingroup iface_wl_pointer */ static inline void wl_pointer_release(struct wl_pointer *wl_pointer) { wl_proxy_marshal((struct wl_proxy *) wl_pointer, WL_POINTER_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_pointer); } #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM /** * @ingroup iface_wl_keyboard * keyboard mapping format * * This specifies the format of the keymap provided to the * client with the wl_keyboard.keymap event. */ enum wl_keyboard_keymap_format { /** * no keymap; client must understand how to interpret the raw keycode */ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0, /** * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode */ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1, }; #endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */ #ifndef WL_KEYBOARD_KEY_STATE_ENUM #define WL_KEYBOARD_KEY_STATE_ENUM /** * @ingroup iface_wl_keyboard * physical key state * * Describes the physical state of a key which provoked the key event. */ enum wl_keyboard_key_state { /** * key is not pressed */ WL_KEYBOARD_KEY_STATE_RELEASED = 0, /** * key is pressed */ WL_KEYBOARD_KEY_STATE_PRESSED = 1, }; #endif /* WL_KEYBOARD_KEY_STATE_ENUM */ /** * @ingroup iface_wl_keyboard * @struct wl_keyboard_listener */ struct wl_keyboard_listener { /** * keyboard mapping * * This event provides a file descriptor to the client which can * be memory-mapped to provide a keyboard mapping description. */ void (*keymap)(void *data, struct wl_keyboard *wl_keyboard, uint32_t format, int32_t fd, uint32_t size); /** * enter event * * Notification that this seat's keyboard focus is on a certain * surface. * @param keys the currently pressed keys */ void (*enter)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys); /** * leave event * * Notification that this seat's keyboard focus is no longer on a * certain surface. * * The leave notification is sent before the enter notification for * the new focus. */ void (*leave)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface); /** * key event * * A key was pressed or released. The time argument is a * timestamp with millisecond granularity, with an undefined base. * @param time timestamp with millisecond granularity */ void (*key)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state); /** * modifier and group state * * Notifies clients that the modifier and/or group state has * changed, and it should update its local state. */ void (*modifiers)(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); /** * repeat rate and delay * * Informs the client about the keyboard's repeat rate and delay. * * This event is sent as soon as the wl_keyboard object has been * created, and is guaranteed to be received by the client before * any key press event. * * Negative values for either rate or delay are illegal. A rate of * zero will disable any repeating (regardless of the value of * delay). * * This event can be sent later on as well with a new value if * necessary, so clients should continue listening for the event * past the creation of wl_keyboard. * @param rate the rate of repeating keys in characters per second * @param delay delay in milliseconds since key down until repeating starts * @since 4 */ void (*repeat_info)(void *data, struct wl_keyboard *wl_keyboard, int32_t rate, int32_t delay); }; /** * @ingroup iface_wl_keyboard */ static inline int wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard, const struct wl_keyboard_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard, (void (**)(void)) listener, data); } #define WL_KEYBOARD_RELEASE 0 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_ENTER_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_LEAVE_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_KEY_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4 /** * @ingroup iface_wl_keyboard */ #define WL_KEYBOARD_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_keyboard */ static inline void wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data); } /** @ingroup iface_wl_keyboard */ static inline void * wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard) { return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard); } static inline uint32_t wl_keyboard_get_version(struct wl_keyboard *wl_keyboard) { return wl_proxy_get_version((struct wl_proxy *) wl_keyboard); } /** @ingroup iface_wl_keyboard */ static inline void wl_keyboard_destroy(struct wl_keyboard *wl_keyboard) { wl_proxy_destroy((struct wl_proxy *) wl_keyboard); } /** * @ingroup iface_wl_keyboard */ static inline void wl_keyboard_release(struct wl_keyboard *wl_keyboard) { wl_proxy_marshal((struct wl_proxy *) wl_keyboard, WL_KEYBOARD_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_keyboard); } /** * @ingroup iface_wl_touch * @struct wl_touch_listener */ struct wl_touch_listener { /** * touch down event and beginning of a touch sequence * * A new touch point has appeared on the surface. This touch * point is assigned a unique @id. Future events from this * touchpoint reference this ID. The ID ceases to be valid after a * touch up event and may be re-used in the future. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point * @param x x coordinate in surface-relative coordinates * @param y y coordinate in surface-relative coordinates */ void (*down)(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y); /** * end of a touch event sequence * * The touch point has disappeared. No further events will be * sent for this touchpoint and the touch point's ID is released * and may be re-used in a future touch down event. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point */ void (*up)(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id); /** * update of touch point coordinates * * A touchpoint has changed coordinates. * @param time timestamp with millisecond granularity * @param id the unique ID of this touch point * @param x x coordinate in surface-relative coordinates * @param y y coordinate in surface-relative coordinates */ void (*motion)(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y); /** * end of touch frame event * * Indicates the end of a contact point list. */ void (*frame)(void *data, struct wl_touch *wl_touch); /** * touch session cancelled * * Sent if the compositor decides the touch stream is a global * gesture. No further events are sent to the clients from that * particular gesture. Touch cancellation applies to all touch * points currently active on this client's surface. The client is * responsible for finalizing the touch points, future touch points * on this surface may re-use the touch point ID. */ void (*cancel)(void *data, struct wl_touch *wl_touch); }; /** * @ingroup iface_wl_touch */ static inline int wl_touch_add_listener(struct wl_touch *wl_touch, const struct wl_touch_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_touch, (void (**)(void)) listener, data); } #define WL_TOUCH_RELEASE 0 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_DOWN_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_UP_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_MOTION_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_FRAME_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_CANCEL_SINCE_VERSION 1 /** * @ingroup iface_wl_touch */ #define WL_TOUCH_RELEASE_SINCE_VERSION 3 /** @ingroup iface_wl_touch */ static inline void wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data); } /** @ingroup iface_wl_touch */ static inline void * wl_touch_get_user_data(struct wl_touch *wl_touch) { return wl_proxy_get_user_data((struct wl_proxy *) wl_touch); } static inline uint32_t wl_touch_get_version(struct wl_touch *wl_touch) { return wl_proxy_get_version((struct wl_proxy *) wl_touch); } /** @ingroup iface_wl_touch */ static inline void wl_touch_destroy(struct wl_touch *wl_touch) { wl_proxy_destroy((struct wl_proxy *) wl_touch); } /** * @ingroup iface_wl_touch */ static inline void wl_touch_release(struct wl_touch *wl_touch) { wl_proxy_marshal((struct wl_proxy *) wl_touch, WL_TOUCH_RELEASE); wl_proxy_destroy((struct wl_proxy *) wl_touch); } #ifndef WL_OUTPUT_SUBPIXEL_ENUM #define WL_OUTPUT_SUBPIXEL_ENUM /** * @ingroup iface_wl_output * subpixel geometry information * * This enumeration describes how the physical * pixels on an output are layed out. */ enum wl_output_subpixel { WL_OUTPUT_SUBPIXEL_UNKNOWN = 0, WL_OUTPUT_SUBPIXEL_NONE = 1, WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2, WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3, WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4, WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5, }; #endif /* WL_OUTPUT_SUBPIXEL_ENUM */ #ifndef WL_OUTPUT_TRANSFORM_ENUM #define WL_OUTPUT_TRANSFORM_ENUM /** * @ingroup iface_wl_output * transform from framebuffer to output * * This describes the transform that a compositor will apply to a * surface to compensate for the rotation or mirroring of an * output device. * * The flipped values correspond to an initial flip around a * vertical axis followed by rotation. * * The purpose is mainly to allow clients render accordingly and * tell the compositor, so that for fullscreen surfaces, the * compositor will still be able to scan out directly from client * surfaces. */ enum wl_output_transform { WL_OUTPUT_TRANSFORM_NORMAL = 0, WL_OUTPUT_TRANSFORM_90 = 1, WL_OUTPUT_TRANSFORM_180 = 2, WL_OUTPUT_TRANSFORM_270 = 3, WL_OUTPUT_TRANSFORM_FLIPPED = 4, WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5, WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6, WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7, }; #endif /* WL_OUTPUT_TRANSFORM_ENUM */ #ifndef WL_OUTPUT_MODE_ENUM #define WL_OUTPUT_MODE_ENUM /** * @ingroup iface_wl_output * mode information * * These flags describe properties of an output mode. * They are used in the flags bitfield of the mode event. */ enum wl_output_mode { /** * indicates this is the current mode */ WL_OUTPUT_MODE_CURRENT = 0x1, /** * indicates this is the preferred mode */ WL_OUTPUT_MODE_PREFERRED = 0x2, }; #endif /* WL_OUTPUT_MODE_ENUM */ /** * @ingroup iface_wl_output * @struct wl_output_listener */ struct wl_output_listener { /** * properties of the output * * The geometry event describes geometric properties of the * output. The event is sent when binding to the output object and * whenever any of the properties change. * @param x x position within the global compositor space * @param y y position within the global compositor space * @param physical_width width in millimeters of the output * @param physical_height height in millimeters of the output * @param subpixel subpixel orientation of the output * @param make textual description of the manufacturer * @param model textual description of the model * @param transform transform that maps framebuffer to output */ void (*geometry)(void *data, struct wl_output *wl_output, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform); /** * advertise available modes for the output * * The mode event describes an available mode for the output. * * The event is sent when binding to the output object and there * will always be one mode, the current mode. The event is sent * again if an output changes mode, for the mode that is now * current. In other words, the current mode is always the last * mode that was received with the current flag set. * * The size of a mode is given in physical hardware units of the * output device. This is not necessarily the same as the output * size in the global compositor space. For instance, the output * may be scaled, as described in wl_output.scale, or transformed , * as described in wl_output.transform. * @param flags bitfield of mode flags * @param width width of the mode in hardware units * @param height height of the mode in hardware units * @param refresh vertical refresh rate in mHz */ void (*mode)(void *data, struct wl_output *wl_output, uint32_t flags, int32_t width, int32_t height, int32_t refresh); /** * sent all information about output * * This event is sent after all other properties has been sent * after binding to the output object and after any other property * changes done after that. This allows changes to the output * properties to be seen as atomic, even if they happen via * multiple events. * @since 2 */ void (*done)(void *data, struct wl_output *wl_output); /** * output scaling properties * * This event contains scaling geometry information that is not * in the geometry event. It may be sent after binding the output * object or if the output scale changes later. If it is not sent, * the client should assume a scale of 1. * * A scale larger than 1 means that the compositor will * automatically scale surface buffers by this amount when * rendering. This is used for very high resolution displays where * applications rendering at the native resolution would be too * small to be legible. * * It is intended that scaling aware clients track the current * output of a surface, and if it is on a scaled output it should * use wl_surface.set_buffer_scale with the scale of the output. * That way the compositor can avoid scaling the surface, and the * client can supply a higher detail image. * @param factor scaling factor of output * @since 2 */ void (*scale)(void *data, struct wl_output *wl_output, int32_t factor); }; /** * @ingroup iface_wl_output */ static inline int wl_output_add_listener(struct wl_output *wl_output, const struct wl_output_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) wl_output, (void (**)(void)) listener, data); } /** * @ingroup iface_wl_output */ #define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_MODE_SINCE_VERSION 1 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_DONE_SINCE_VERSION 2 /** * @ingroup iface_wl_output */ #define WL_OUTPUT_SCALE_SINCE_VERSION 2 /** @ingroup iface_wl_output */ static inline void wl_output_set_user_data(struct wl_output *wl_output, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data); } /** @ingroup iface_wl_output */ static inline void * wl_output_get_user_data(struct wl_output *wl_output) { return wl_proxy_get_user_data((struct wl_proxy *) wl_output); } static inline uint32_t wl_output_get_version(struct wl_output *wl_output) { return wl_proxy_get_version((struct wl_proxy *) wl_output); } /** @ingroup iface_wl_output */ static inline void wl_output_destroy(struct wl_output *wl_output) { wl_proxy_destroy((struct wl_proxy *) wl_output); } #define WL_REGION_DESTROY 0 #define WL_REGION_ADD 1 #define WL_REGION_SUBTRACT 2 /** * @ingroup iface_wl_region */ #define WL_REGION_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_region */ #define WL_REGION_ADD_SINCE_VERSION 1 /** * @ingroup iface_wl_region */ #define WL_REGION_SUBTRACT_SINCE_VERSION 1 /** @ingroup iface_wl_region */ static inline void wl_region_set_user_data(struct wl_region *wl_region, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data); } /** @ingroup iface_wl_region */ static inline void * wl_region_get_user_data(struct wl_region *wl_region) { return wl_proxy_get_user_data((struct wl_proxy *) wl_region); } static inline uint32_t wl_region_get_version(struct wl_region *wl_region) { return wl_proxy_get_version((struct wl_proxy *) wl_region); } /** * @ingroup iface_wl_region * * Destroy the region. This will invalidate the object ID. */ static inline void wl_region_destroy(struct wl_region *wl_region) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_region); } /** * @ingroup iface_wl_region * * Add the specified rectangle to the region. */ static inline void wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_ADD, x, y, width, height); } /** * @ingroup iface_wl_region * * Subtract the specified rectangle from the region. */ static inline void wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_region, WL_REGION_SUBTRACT, x, y, width, height); } #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM #define WL_SUBCOMPOSITOR_ERROR_ENUM enum wl_subcompositor_error { /** * the to-be sub-surface is invalid */ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ #define WL_SUBCOMPOSITOR_DESTROY 0 #define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 /** * @ingroup iface_wl_subcompositor */ #define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_subcompositor */ #define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1 /** @ingroup iface_wl_subcompositor */ static inline void wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); } /** @ingroup iface_wl_subcompositor */ static inline void * wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor) { return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); } static inline uint32_t wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor) { return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor); } /** * @ingroup iface_wl_subcompositor * * Informs the server that the client will not be using this * protocol object anymore. This does not affect any other * objects, wl_subsurface objects included. */ static inline void wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) { wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, WL_SUBCOMPOSITOR_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); } /** * @ingroup iface_wl_subcompositor * * Create a sub-surface interface for the given surface, and * associate it with the given parent surface. This turns a * plain wl_surface into a sub-surface. * * The to-be sub-surface must not already have a dedicated * purpose, like any shell surface type, cursor image, drag icon, * or sub-surface. Otherwise a protocol error is raised. */ static inline struct wl_subsurface * wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_subcompositor, WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, NULL, surface, parent); return (struct wl_subsurface *) id; } #ifndef WL_SUBSURFACE_ERROR_ENUM #define WL_SUBSURFACE_ERROR_ENUM enum wl_subsurface_error { /** * wl_surface is not a sibling or the parent */ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, }; #endif /* WL_SUBSURFACE_ERROR_ENUM */ #define WL_SUBSURFACE_DESTROY 0 #define WL_SUBSURFACE_SET_POSITION 1 #define WL_SUBSURFACE_PLACE_ABOVE 2 #define WL_SUBSURFACE_PLACE_BELOW 3 #define WL_SUBSURFACE_SET_SYNC 4 #define WL_SUBSURFACE_SET_DESYNC 5 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1 /** * @ingroup iface_wl_subsurface */ #define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1 /** @ingroup iface_wl_subsurface */ static inline void wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); } /** @ingroup iface_wl_subsurface */ static inline void * wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) { return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); } static inline uint32_t wl_subsurface_get_version(struct wl_subsurface *wl_subsurface) { return wl_proxy_get_version((struct wl_proxy *) wl_subsurface); } /** * @ingroup iface_wl_subsurface * * The sub-surface interface is removed from the wl_surface object * that was turned into a sub-surface with * wl_subcompositor.get_subsurface request. The wl_surface's association * to the parent is deleted, and the wl_surface loses its role as * a sub-surface. The wl_surface is unmapped. */ static inline void wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_subsurface); } /** * @ingroup iface_wl_subsurface * * This schedules a sub-surface position change. * The sub-surface will be moved so, that its origin (top-left * corner pixel) will be at the location x, y of the parent surface * coordinate system. The coordinates are not restricted to the parent * surface area. Negative values are allowed. * * The next wl_surface.commit on the parent surface will reset * the sub-surface's position to the scheduled coordinates. * * If more than one set_position request is invoked by the client before * the commit of the parent surface, the position of a new request always * replaces the scheduled position from any previous request. * * The initial position is 0, 0. */ static inline void wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_POSITION, x, y); } /** * @ingroup iface_wl_subsurface * * This sub-surface is taken from the stack, and put back just * above the reference surface, changing the z-order of the sub-surfaces. * The reference surface must be one of the sibling surfaces, or the * parent surface. Using any other surface, including this sub-surface, * will cause a protocol error. * * The z-order is double-buffered. Requests are handled in order and * applied immediately to a pending state, then committed to the active * state on the next commit of the parent surface. * See wl_surface.commit and wl_subcompositor.get_subsurface. * * A new sub-surface is initially added as the top-most in the stack * of its siblings and parent. */ static inline void wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_PLACE_ABOVE, sibling); } /** * @ingroup iface_wl_subsurface * * The sub-surface is placed just below of the reference surface. * See wl_subsurface.place_above. */ static inline void wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_PLACE_BELOW, sibling); } /** * @ingroup iface_wl_subsurface * * Change the commit behaviour of the sub-surface to synchronized * mode, also described as the parent dependant mode. * * In synchronized mode, wl_surface.commit on a sub-surface will * accumulate the committed state in a cache, but the state will * not be applied and hence will not change the compositor output. * The cached state is applied to the sub-surface immediately after * the parent surface's state is applied. This ensures atomic * updates of the parent and all its synchronized sub-surfaces. * Applying the cached state will invalidate the cache, so further * parent surface commits do not (re-)apply old state. * * See wl_subsurface for the recursive effect of this mode. */ static inline void wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_SYNC); } /** * @ingroup iface_wl_subsurface * * Change the commit behaviour of the sub-surface to desynchronized * mode, also described as independent or freely running mode. * * In desynchronized mode, wl_surface.commit on a sub-surface will * apply the pending state directly, without caching, as happens * normally with a wl_surface. Calling wl_surface.commit on the * parent surface has no effect on the sub-surface's wl_surface * state. This mode allows a sub-surface to be updated on its own. * * If cached state exists when wl_surface.commit is called in * desynchronized mode, the pending state is added to the cached * state, and applied as whole. This invalidates the cache. * * Note: even if a sub-surface is set to desynchronized, a parent * sub-surface may override it to behave as synchronized. For details, * see wl_subsurface. * * If a surface's parent surface behaves as desynchronized, then * the cached state is applied on set_desync. */ static inline void wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface) { wl_proxy_marshal((struct wl_proxy *) wl_subsurface, WL_SUBSURFACE_SET_DESYNC); } #ifdef __cplusplus } #endif #endif wayland-xdg-output-unstable-v1-client-protocol.h000066400000000000000000000322421476226662200403670ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/* Generated by wayland-scanner 1.16.0 */ #ifndef XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #define XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #include #include #include "wayland-client.h" #ifdef __cplusplus extern "C" { #endif /** * @page page_xdg_output_unstable_v1 The xdg_output_unstable_v1 protocol * Protocol to describe output regions * * @section page_desc_xdg_output_unstable_v1 Description * * This protocol aims at describing outputs in a way which is more in line * with the concept of an output on desktop oriented systems. * * Some information are more specific to the concept of an output for * a desktop oriented system and may not make sense in other applications, * such as IVI systems for example. * * Typically, the global compositor space on a desktop system is made of * a contiguous or overlapping set of rectangular regions. * * Some of the information provided in this protocol might be identical * to their counterparts already available from wl_output, in which case * the information provided by this protocol should be preferred to their * equivalent in wl_output. The goal is to move the desktop specific * concepts (such as output location within the global compositor space, * the connector name and types, etc.) out of the core wl_output protocol. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible * changes may be added together with the corresponding interface * version bump. * Backward incompatible changes are done by bumping the version * number in the protocol and interface names and resetting the * interface version. Once the protocol is to be declared stable, * the 'z' prefix and the version number in the protocol and * interface names are removed and the interface version number is * reset. * * @section page_ifaces_xdg_output_unstable_v1 Interfaces * - @subpage page_iface_zxdg_output_manager_v1 - manage xdg_output objects * - @subpage page_iface_zxdg_output_v1 - compositor logical output region * @section page_copyright_xdg_output_unstable_v1 Copyright *
 *
 * Copyright © 2017 Red Hat Inc.
 *
 * 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 (including the next
 * paragraph) 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.
 * 
*/ struct wl_output; struct zxdg_output_manager_v1; struct zxdg_output_v1; /** * @page page_iface_zxdg_output_manager_v1 zxdg_output_manager_v1 * @section page_iface_zxdg_output_manager_v1_desc Description * * A global factory interface for xdg_output objects. * @section page_iface_zxdg_output_manager_v1_api API * See @ref iface_zxdg_output_manager_v1. */ /** * @defgroup iface_zxdg_output_manager_v1 The zxdg_output_manager_v1 interface * * A global factory interface for xdg_output objects. */ extern const struct wl_interface zxdg_output_manager_v1_interface; /** * @page page_iface_zxdg_output_v1 zxdg_output_v1 * @section page_iface_zxdg_output_v1_desc Description * * An xdg_output describes part of the compositor geometry. * * This typically corresponds to a monitor that displays part of the * compositor space. * @section page_iface_zxdg_output_v1_api API * See @ref iface_zxdg_output_v1. */ /** * @defgroup iface_zxdg_output_v1 The zxdg_output_v1 interface * * An xdg_output describes part of the compositor geometry. * * This typically corresponds to a monitor that displays part of the * compositor space. */ extern const struct wl_interface zxdg_output_v1_interface; #define ZXDG_OUTPUT_MANAGER_V1_DESTROY 0 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT 1 /** * @ingroup iface_zxdg_output_manager_v1 */ #define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_manager_v1 */ #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1 /** @ingroup iface_zxdg_output_manager_v1 */ static inline void zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_manager_v1, user_data); } /** @ingroup iface_zxdg_output_manager_v1 */ static inline void * zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_manager_v1); } static inline uint32_t zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { return wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1); } /** * @ingroup iface_zxdg_output_manager_v1 * * Using this request a client can tell the server that it is not * going to use the xdg_output_manager object anymore. * * Any objects already created through this instance are not affected. */ static inline void zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) { wl_proxy_marshal((struct wl_proxy *) zxdg_output_manager_v1, ZXDG_OUTPUT_MANAGER_V1_DESTROY); wl_proxy_destroy((struct wl_proxy *) zxdg_output_manager_v1); } /** * @ingroup iface_zxdg_output_manager_v1 * * This creates a new xdg_output object for the given wl_output. */ static inline struct zxdg_output_v1 * zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, struct wl_output *output) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_output_manager_v1, ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, NULL, output); return (struct zxdg_output_v1 *) id; } /** * @ingroup iface_zxdg_output_v1 * @struct zxdg_output_v1_listener */ struct zxdg_output_v1_listener { /** * position of the output within the global compositor space * * The position event describes the location of the wl_output * within the global compositor space. * * The logical_position event is sent after creating an xdg_output * (see xdg_output_manager.get_xdg_output) and whenever the * location of the output changes within the global compositor * space. * @param x x position within the global compositor space * @param y y position within the global compositor space */ void (*logical_position)(void *data, struct zxdg_output_v1 *zxdg_output_v1, int32_t x, int32_t y); /** * size of the output in the global compositor space * * The logical_size event describes the size of the output in the * global compositor space. * * For example, a surface without any buffer scale, transformation * nor rotation set, with the size matching the logical_size will * have the same size as the corresponding output when displayed. * * Most regular Wayland clients should not pay attention to the * logical size and would rather rely on xdg_shell interfaces. * * Some clients such as Xwayland, however, need this to configure * their surfaces in the global compositor space as the compositor * may apply a different scale from what is advertised by the * output scaling property (to achieve fractional scaling, for * example). * * For example, for a wl_output mode 3840×2160 and a scale factor * 2: * * - A compositor not scaling the surface buffers will advertise a * logical size of 3840×2160, * * - A compositor automatically scaling the surface buffers will * advertise a logical size of 1920×1080, * * - A compositor using a fractional scale of 1.5 will advertise a * logical size to 2560×1620. * * For example, for a wl_output mode 1920×1080 and a 90 degree * rotation, the compositor will advertise a logical size of * 1080x1920. * * The logical_size event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output) and whenever the logical size * of the output changes, either as a result of a change in the * applied scale or because of a change in the corresponding output * mode(see wl_output.mode) or transform (see wl_output.transform). * @param width width in global compositor space * @param height height in global compositor space */ void (*logical_size)(void *data, struct zxdg_output_v1 *zxdg_output_v1, int32_t width, int32_t height); /** * all information about the output have been sent * * This event is sent after all other properties of an xdg_output * have been sent. * * This allows changes to the xdg_output properties to be seen as * atomic, even if they happen via multiple events. */ void (*done)(void *data, struct zxdg_output_v1 *zxdg_output_v1); /** * name of this output * * Many compositors will assign names to their outputs, show them * to the user, allow them to be configured by name, etc. The * client may wish to know this name as well to offer the user * similar behaviors. * * The naming convention is compositor defined, but limited to * alphanumeric characters and dashes (-). Each name is unique * among all wl_output globals, but if a wl_output global is * destroyed the same name may be reused later. The names will also * remain consistent across sessions with the same hardware and * software configuration. * * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. * However, do not assume that the name is a reflection of an * underlying DRM connector, X11 connection, etc. * * The name event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output). This event is only sent once * per xdg_output, and the name does not change over the lifetime * of the wl_output global. * @param name output name * @since 2 */ void (*name)(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *name); /** * human-readable description of this output * * Many compositors can produce human-readable descriptions of * their outputs. The client may wish to know this description as * well, to communicate the user for various purposes. * * The description is a UTF-8 string with no convention defined for * its contents. Examples might include 'Foocorp 11" Display' or * 'Virtual X11 output via :1'. * * The description event is sent after creating an xdg_output (see * xdg_output_manager.get_xdg_output). This event is only sent once * per xdg_output, and the description does not change over the * lifetime of the wl_output global. The description is optional, * and may not be sent at all. * @param description output description * @since 2 */ void (*description)(void *data, struct zxdg_output_v1 *zxdg_output_v1, const char *description); }; /** * @ingroup iface_zxdg_output_v1 */ static inline int zxdg_output_v1_add_listener(struct zxdg_output_v1 *zxdg_output_v1, const struct zxdg_output_v1_listener *listener, void *data) { return wl_proxy_add_listener((struct wl_proxy *) zxdg_output_v1, (void (**)(void)) listener, data); } #define ZXDG_OUTPUT_V1_DESTROY 0 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2 /** * @ingroup iface_zxdg_output_v1 */ #define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zxdg_output_v1 */ static inline void zxdg_output_v1_set_user_data(struct zxdg_output_v1 *zxdg_output_v1, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_v1, user_data); } /** @ingroup iface_zxdg_output_v1 */ static inline void * zxdg_output_v1_get_user_data(struct zxdg_output_v1 *zxdg_output_v1) { return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_v1); } static inline uint32_t zxdg_output_v1_get_version(struct zxdg_output_v1 *zxdg_output_v1) { return wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1); } /** * @ingroup iface_zxdg_output_v1 * * Using this request a client can tell the server that it is not * going to use the xdg_output object anymore. */ static inline void zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1) { wl_proxy_marshal((struct wl_proxy *) zxdg_output_v1, ZXDG_OUTPUT_V1_DESTROY); wl_proxy_destroy((struct wl_proxy *) zxdg_output_v1); } #ifdef __cplusplus } #endif #endif qt5platform-plugins-5.7.12/wayland/wayland-shell/000077500000000000000000000000001476226662200217635ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/wayland-shell/CMakeLists.txt000066400000000000000000000046111476226662200245250ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later project(kwayland-shell) find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets WaylandClient) if(${QT_VERSION_MAJOR} STREQUAL "5") find_package(Qt5 REQUIRED COMPONENTS XkbCommonSupport) endif() include(wayland-shell.cmake) try_compile(DEEPIN_KWIN_TEST_COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR}/deepin-kwin-test ${CMAKE_CURRENT_LIST_DIR}/config.tests/deepin-kwin-test deepin-kwin-test CMAKE_FLAGS -DQT_VERSION_MAJOR=${QT_VERSION_MAJOR}) try_compile(WAYLAND_TEST_COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR}/wayland_test ${CMAKE_CURRENT_LIST_DIR}/config.tests/wayland_test wayland_test CMAKE_FLAGS -DQT_VERSION_MAJOR=${QT_VERSION_MAJOR}) if(WAYLAND_TEST_COMPILE_RESULT) add_definitions(-DUSE_DEEPIN_WAYLAND) set(GLOBAL_HEADERS dwaylandshellmanager.h dkeyboard.h ${CMAKE_SOURCE_DIR}/src/global.h ${CMAKE_SOURCE_DIR}/src/vtablehook.h ) set(GLOBAL_SOURCES dwaylandshellmanager.cpp dkeyboard.cpp ${CMAKE_SOURCE_DIR}/src/global.cpp ${CMAKE_SOURCE_DIR}/src/vtablehook.cpp ) else() message(WARNING "QtWayland version incompatible") endif() add_library(${PROJECT_NAME} MODULE main.cpp ${GLOBAL_SOURCES} ${GLOBAL_HEADERS}) set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/wayland-shell-integration ) target_compile_definitions(${PROJECT_NAME} PRIVATE QT5DWAYLANDPLUGIN_LIBRARY QT_DEPRECATED_WARNINGS ) if(DEEPIN_KWIN_TEST_COMPILE_RESULT) target_compile_definitions(${PROJECT_NAME} PRIVATE D_DEEPIN_KWIN) endif() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src) list(APPEND COMMON_LIBS Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::WidgetsPrivate Qt${QT_VERSION_MAJOR}::WaylandClient ) if(${QT_VERSION_MAJOR} STREQUAL "5") list(APPEND COMMON_LIBS Qt5::XkbCommonSupportPrivate Qt5::WaylandClientPrivate) endif() target_link_libraries(${PROJECT_NAME} ${COMMON_LIBS}) if(NOT INSTALL_PATH) set(INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins/wayland-shell-integration) endif() install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_PATH}) qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/000077500000000000000000000000001476226662200243715ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/deepin-kwin-test/000077500000000000000000000000001476226662200275605ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/deepin-kwin-test/CMakeLists.txt000066400000000000000000000021741476226662200323240ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later cmake_minimum_required(VERSION 3.13) project(deepin-kwin-test) set(REQUIRED_QT_VERSION 5.15.0) find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS WaylandClient) include(../../wayland-shell.cmake) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(AUTOMOC_COMPILER_PREDEFINES ON) add_executable(${PROJECT_NAME} main.cpp) if("${QT_VERSION_MAJOR}" STREQUAL "5") list(APPEND COMMON_LIBS Qt5::WaylandClientPrivate) endif() target_link_libraries(${PROJECT_NAME} PUBLIC ${COMMON_LIBS}) if(${QT_VERSION_MAJOR} STREQUAL "6") list(GET Qt6WaylandClient_PRIVATE_INCLUDE_DIRS 0 dir) if(EXISTS ${dir}) target_include_directories(${PROJECT_NAME} PRIVATE ${Qt6WaylandClient_PRIVATE_INCLUDE_DIRS}) else() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../../qtwayland-dev/${Qt6_VERSION}) endif() endif() target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/deepin-kwin-test/main.cpp000066400000000000000000000005241476226662200312110ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef D_DEEPIN_IS_DWAYLAND #include #else #include #endif int main() { KWayland::Client::PlasmaShellSurface::Role::Override; return 0; } qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/wayland_test/000077500000000000000000000000001476226662200270675ustar00rootroot00000000000000qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/wayland_test/CMakeLists.txt000066400000000000000000000020261476226662200316270ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later cmake_minimum_required(VERSION 3.13) project(wayland_test) set(REQUIRED_QT_VERSION 5.15.0) find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui WaylandClient) if(${QT_VERSION_MAJOR} STREQUAL "5") find_package(Qt5 REQUIRED COMPONENTS XkbCommonSupport) endif() include(../../wayland-shell.cmake) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(AUTOMOC_COMPILER_PREDEFINES ON) add_executable(${PROJECT_NAME} main.cpp) list(APPEND COMMON_LIBS Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::CorePrivate Qt${QT_VERSION_MAJOR}::GuiPrivate ) if(${QT_VERSION_MAJOR} STREQUAL "5") list(APPEND COMMON_LIBS Qt5::WaylandClientPrivate Qt5::XkbCommonSupportPrivate) endif() target_link_libraries(${PROJECT_NAME} PUBLIC ${COMMON_LIBS}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) qt5platform-plugins-5.7.12/wayland/wayland-shell/config.tests/wayland_test/main.cpp000066400000000000000000000020531476226662200305170ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include #include #include #include #include #include #include #include #include #ifndef D_DEEPIN_IS_DWAYLAND #include #include #else #include #include #endif using namespace QtWaylandClient; int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) QWaylandDisplay *display = static_cast( QGuiApplicationPrivate::platformIntegration()) ->display(); display->usingInputContextFromCompositor(); #endif return 0; } qt5platform-plugins-5.7.12/wayland/wayland-shell/dkeyboard.cpp000066400000000000000000000117441476226662200244420ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dkeyboard.h" #include #include #include #include #include #include #include #include #include #ifndef QT_DEBUG Q_LOGGING_CATEGORY(dkeyboard, "dkeyboard.wayland.plugin" , QtInfoMsg); #else Q_LOGGING_CATEGORY(dkeyboard, "dkeyboard.wayland.plugin"); #endif //#if QT_CONFIG(xkbcommon) static QXkbCommon::ScopedXKBKeymap mXkbKeymap; static QXkbCommon::ScopedXKBState mXkbState; static uint32_t mNativeModifiers = 0; namespace QtWaylandClient { // from qtwayland... static void handleKey(QWindow *window, ulong timestamp, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text, bool autorepeat = false, ushort count = 1) { QPlatformInputContext *inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext(); bool filtered = false; bool usingInputContextFromCompositor = true; #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) QWaylandDisplay *display = static_cast(QGuiApplicationPrivate::platformIntegration())->display(); usingInputContextFromCompositor = display && !display->usingInputContextFromCompositor(); #endif if (inputContext && usingInputContextFromCompositor) { QKeyEvent event(type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorepeat, count); event.setTimestamp(timestamp); filtered = inputContext->filterEvent(&event); } if (!filtered) { if (type == QEvent::KeyPress && key == Qt::Key_Menu) { auto cursor = window->screen()->handle()->cursor(); if (cursor) { const QPoint globalPos = cursor->pos(); const QPoint pos = window->mapFromGlobal(globalPos); QWindowSystemInterface::handleContextMenuEvent(window, false, pos, globalPos, modifiers); } } QWindowSystemInterface::handleExtendedKeyEvent(window, timestamp, type, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorepeat, count); } } static bool createDefaultKeymap() { auto ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!ctx) return false; struct xkb_rule_names names; names.rules = "evdev"; names.model = "pc105"; names.layout = "us"; names.variant = ""; names.options = ""; mXkbKeymap.reset(xkb_keymap_new_from_names(ctx, &names, XKB_KEYMAP_COMPILE_NO_FLAGS)); if (mXkbKeymap) mXkbState.reset(xkb_state_new(mXkbKeymap.get())); if (!mXkbKeymap || !mXkbState) { qCWarning(dkeyboard) << "failed to create default keymap"; return false; } return true; } // #endif //QT_CONFIG(xkbcommon) DKeyboard::DKeyboard(QObject *parent) : QObject(parent) { } DKeyboard::~DKeyboard() { } void DKeyboard::handleKeyEvent(quint32 key, DDEKeyboard::KeyState state, quint32 time) { QWaylandWindow *window = dynamic_cast(parent()); if (!window || !window->window() || window->isActive()) return; //#if QT_CONFIG(xkbcommon) if ((!mXkbKeymap || !mXkbState) && !createDefaultKeymap()) return; QEvent::Type type = state == DDEKeyboard::KeyState::Pressed ? QEvent::KeyPress : QEvent::KeyRelease; // qCDebug(dkeyboard) << __func__ << " key " << key << " state " << int(state) << " time " << time; auto code = key + 8; // map to wl_keyboard::keymap_format::keymap_format_xkb_v1 xkb_keysym_t sym = xkb_state_key_get_one_sym(mXkbState.get(), code); Qt::KeyboardModifiers modifiers = QXkbCommon::modifiers(mXkbState.get()); QString text = QXkbCommon::lookupString(mXkbState.get(), code); int qtkey = QXkbCommon::keysymToQtKey(sym, modifiers, mXkbState.get(), code); qCDebug(dkeyboard) << __func__ << "type" << type << "qtkey" << qtkey << "mNativeModifiers" << mNativeModifiers << "modifiers" << modifiers << "text" << text; handleKey(window->window(), time, type, qtkey, modifiers, code, sym, mNativeModifiers, text); //#endif } void DKeyboard::handleModifiersChanged(quint32 depressed, quint32 latched, quint32 locked, quint32 group) { qCDebug(dkeyboard) << __func__ << " depressed " << depressed << " latched " << latched << " locked " << locked << " group " << group; if (mXkbState) xkb_state_update_mask(mXkbState.get(), depressed, latched, locked, 0, 0, group); mNativeModifiers = depressed | latched | locked; } } qt5platform-plugins-5.7.12/wayland/wayland-shell/dkeyboard.h000066400000000000000000000013271476226662200241030ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DKEYBOARD_H #define DKEYBOARD_H #include #ifndef D_DEEPIN_IS_DWAYLAND #include #else #include #endif using namespace KWayland::Client; namespace QtWaylandClient { class DKeyboard : public QObject { Q_OBJECT public: explicit DKeyboard(QObject *parent = nullptr); virtual ~DKeyboard(); public slots: void handleKeyEvent(quint32 key, DDEKeyboard::KeyState state, quint32 time); void handleModifiersChanged(quint32 depressed, quint32 latched, quint32 locked, quint32 group); }; } #endif // DKEYBOARD_H qt5platform-plugins-5.7.12/wayland/wayland-shell/dwaylandshellmanager.cpp000066400000000000000000001043061476226662200266610ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dwaylandshellmanager.h" #include "dkeyboard.h" #include "global.h" #include "../xcb/utility.h" #define protected public #include #undef protected #include #include #include #ifndef QT_DEBUG Q_LOGGING_CATEGORY(dwlp, "dtk.wayland.plugin" , QtInfoMsg); #else Q_LOGGING_CATEGORY(dwlp, "dtk.wayland.plugin"); #endif DPP_USE_NAMESPACE #define _DWAYALND_ "_d_dwayland_" #define CHECK_PREFIX(key) (key.startsWith(_DWAYALND_) || key.startsWith("_d_")) #define wlDisplay reinterpret_cast(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("display", nullptr)) Q_DECLARE_METATYPE(QPainterPath) namespace QtWaylandClient { namespace { // kwayland中PlasmaShell的全局对象,用于使用kwayland中的扩展协议 PlasmaShell *kwayland_shell = nullptr; // kwin合成器提供的窗口边框管理器 ServerSideDecorationManager *kwayland_ssd = nullptr; // 创建ddeshell DDEShell *ddeShell = nullptr; // kwayland Strut *kwayland_strut = nullptr; DDESeat *kwayland_dde_seat = nullptr; DDETouch *kwayland_dde_touch = nullptr; DDEPointer *kwayland_dde_pointer = nullptr; FakeInput *kwayland_dde_fake_input = nullptr; DDEKeyboard *kwayland_dde_keyboard = nullptr; BlurManager *kwayland_blur_manager = nullptr; Surface *kwayland_surface = nullptr; Compositor *kwayland_compositor = nullptr; PlasmaWindowManagement *kwayland_manage = nullptr; }; QList> DWaylandShellManager::send_property_window_list; inline static wl_surface *getWindowWLSurface(QWaylandWindow *window) { #if QTWAYLANDCLIENT_VERSION >= QT_VERSION_CHECK(5, 14, 0) return window->wlSurface(); #else return window->object(); #endif } static PlasmaShellSurface* createKWayland(QWaylandWindow *window) { if (!window || !kwayland_shell) return nullptr; auto surface = window->shellSurface(); return kwayland_shell->createSurface(getWindowWLSurface(window), surface); } static PlasmaShellSurface *ensureKWaylandSurface(QWaylandShellSurface *self) { if (auto *ksurface = self->findChild(QString(), Qt::FindDirectChildrenOnly)) { return ksurface; } return createKWayland(self->window()); } static DDEShellSurface* createDDESurface(QWaylandShellSurface *shellSurface) { if (!shellSurface || !ddeShell) return nullptr; return ddeShell->createShellSurface(getWindowWLSurface(shellSurface->window()), shellSurface); } static DDEShellSurface *ensureDDEShellSurface(QWaylandShellSurface *shellSurface) { if (!shellSurface) return nullptr; if (auto *shell_surface = shellSurface->findChild(QString(), Qt::FindDirectChildrenOnly)) { return shell_surface; } return createDDESurface(shellSurface); } static Surface *ensureSurface(QWaylandWindow *wlWindow) { if (!kwayland_surface) { qCWarning(dwlp) << "invalid wayland surface"; return nullptr; } if (!wlWindow->window()) { qCWarning(dwlp) << "invalid wlWindow"; return nullptr; } return kwayland_surface->fromWindow(wlWindow->window()); } static Blur *ensureBlur(Surface *surface, QObject *parent = nullptr) { if (parent) { if (auto *blur = parent->findChild(QString(), Qt::FindDirectChildrenOnly)) return blur; } if (!kwayland_blur_manager) { qCWarning(dwlp) << "invalid blur manager"; return nullptr; } return kwayland_blur_manager->createBlur(surface, parent); } static Region *ensureRegion(QObject *parent = nullptr) { if (parent) { if (auto *region = parent->findChild(QString(), Qt::FindDirectChildrenOnly)) { return region; } } if (!kwayland_compositor) { qCWarning(dwlp) << "invalid wayland compositor"; return nullptr; } return kwayland_compositor->createRegion(parent); } static void checkIsDWayland(const QString &function) { #ifndef D_DEEPIN_IS_DWAYLAND qCWarning(dwlp) << "This package is not compiled as dwayland, and [" << function << "] not support in this version."; #endif } DWaylandShellManager::DWaylandShellManager() : m_registry (new Registry()) { } DWaylandShellManager::~DWaylandShellManager() { } void DWaylandShellManager::sendProperty(QWaylandShellSurface *self, const QString &name, const QVariant &value) { // 某些应用程序(比如日历,启动器)调用此方法时 self为空,导致插件崩溃 if (Q_UNLIKELY(!self)) { return; } if (Q_UNLIKELY(!CHECK_PREFIX(name))) { HookCall(self, &QWaylandShellSurface::sendProperty, name, value); return; } QWaylandWindow *wlWindow = self->window(); if (Q_UNLIKELY(!wlWindow)) { qCWarning(dwlp) << "Error, wlWindow is nullptr"; return; } // 如果创建失败则说明kwaylnd_shell对象还未初始化,应当终止设置 // 记录下本次的设置行为,kwayland_shell创建后会重新设置这些属性 auto *ksurface = ensureKWaylandSurface(self); if (Q_UNLIKELY(!ksurface)) { send_property_window_list << wlWindow; return; } if (auto *dde_shell_surface = ensureDDEShellSurface(self)) { if (!name.compare(noTitlebar)) { qCDebug(dwlp()) << "Request NoTitleBar, value: " << value; dde_shell_surface->requestNoTitleBarProperty(value.toBool()); } if (!name.compare(windowRadius)) { bool ok = false; qreal radius = value.toInt(&ok); if (wlWindow->screen()) radius *= wlWindow->screen()->devicePixelRatio(); qCDebug(dwlp()) << "Rquest window radius, value: " << radius << value; if (ok) dde_shell_surface->requestWindowRadiusProperty({radius, radius}); else qCWarning(dwlp) << "invalid property" << name << value; } if (!name.compare(splitWindowOnScreen)) { using KWayland::Client::DDEShellSurface; const auto tmp = value.toList(); if (tmp.size() >= 2) { const auto &position = tmp[0].toInt(); const auto &type = tmp[1].toInt(); checkIsDWayland("requestSplitWindow()"); #ifdef D_DEEPIN_IS_DWAYLAND dde_shell_surface->requestSplitWindow(DDEShellSurface::SplitType(position), DDEShellSurface::SplitMode(type)); qCDebug(dwlp) << "requestSplitWindow splitType: " << position << " mode: " << type; #endif } else { qCWarning(dwlp) << "invalid property: " << name << value; } wlWindow->window()->setProperty(splitWindowOnScreen, 0); } if (!name.compare(supportForSplittingWindow)) { checkIsDWayland("getSplitable()"); #ifdef D_DEEPIN_IS_DWAYLAND wlWindow->window()->setProperty(supportForSplittingWindow, dde_shell_surface->getSplitable()); #endif return; } if (!name.compare(windowInWorkSpace)) { dde_shell_surface->requestOnAllDesktops(value.toBool()); qCDebug(dwlp()) << "### requestOnAllDesktops" << name << value; } if (!name.compare(enableBlurWindow)) { qCDebug(dwlp) << "### enableBlurWindow" << name << value; if (!value.isValid()) { qCWarning(dwlp) << "invalid enableBlurWindow"; return; } setEnableBlurWidow(wlWindow, value); } if (!name.compare(windowBlurAreas) || !name.compare(windowBlurPaths)) { qCDebug(dwlp) << "### requestWindowBlur" << name << value; updateWindowBlurAreasForWM(wlWindow, name, value); } } // 将popup的窗口设置为tooltop层级, 包括qmenu,combobox弹出窗口 if (wlWindow->window()->type() == Qt::Popup) ksurface->setRole(PlasmaShellSurface::Role::ToolTip); #ifdef D_DEEPIN_KWIN // 禁止窗口移动接口适配。 typedef PlasmaShellSurface::Role KRole; if (!name.compare(enableSystemMove)) { ksurface->setRole(value.toBool() ? KRole::Normal : KRole::StandAlone); return; } if (QStringLiteral(_DWAYALND_ "global_keyevent") == name && value.toBool()) { if (wlWindow->findChild(QString(), Qt::FindDirectChildrenOnly)) { return; } DKeyboard *keyboard = new DKeyboard(wlWindow); // 只有关心全局键盘事件才连接, 并且随窗口销毁而断开 QObject::connect(kwayland_dde_keyboard, &DDEKeyboard::keyChanged, keyboard, &DKeyboard::handleKeyEvent); QObject::connect(kwayland_dde_keyboard, &DDEKeyboard::modifiersChanged, keyboard, &DKeyboard::handleModifiersChanged); } #endif if (QStringLiteral(_DWAYALND_ "dockstrut") == name) { setDockStrut(self, value); } if (QStringLiteral(_DWAYALND_ "window-position") == name) { ksurface->setPosition(value.toPoint()); } if (QStringLiteral(_DWAYALND_ "dock-appitem-geometry") == name) { setDockAppItemMinimizedGeometry(self, value); } static const QMap role2type = { {PlasmaShellSurface::Role::Normal, {"normal"}}, {PlasmaShellSurface::Role::Desktop, {"desktop"}}, {PlasmaShellSurface::Role::Panel, {"dock", "panel"}}, {PlasmaShellSurface::Role::OnScreenDisplay, {"wallpaper", "onScreenDisplay"}}, {PlasmaShellSurface::Role::Notification, {"notification"}}, {PlasmaShellSurface::Role::ToolTip, {"tooltip"}}, #ifdef D_DEEPIN_KWIN {PlasmaShellSurface::Role::StandAlone, {"launcher", "standAlone"}}, {PlasmaShellSurface::Role::Override, {"session-shell", "menu", "wallpaper-set", "override"}}, #endif }; if (QStringLiteral(_DWAYALND_ "window-type") == name) { // 根据 type 设置对应的 role const QByteArray &type = value.toByteArray(); for (int i = 0; i <= (int)PlasmaShellSurface::Role::ActiveFullScreen; ++i) { PlasmaShellSurface::Role role = PlasmaShellSurface::Role(i); if (role2type.value(role).contains(type)) { ksurface->setRole(role); if (type == "dock" || type == "panel") { ksurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible); } break; } } } if (QStringLiteral(_DWAYALND_ "staysontop") == name) { setWindowStaysOnTop(self, value.toBool()); } } void DWaylandShellManager::setGeometry(QPlatformWindow *self, const QRect &rect) { HookCall(self, &QPlatformWindow::setGeometry, rect); if (self->QPlatformWindow::parent()) { return; } if (auto wl_window = static_cast(self)) { wl_window->sendProperty(QStringLiteral(_DWAYALND_ "window-position"), rect.topLeft()); } } void DWaylandShellManager::pointerEvent(const QPointF &pointF, QEvent::Type type) { if (Q_UNLIKELY(!(type == QEvent::MouseButtonPress || type == QEvent::MouseButtonRelease || type == QEvent::Move))) { return; } // cursor()->pointerEvent 中只用到 event.globalPos(), 即 pointF 这个参数 for (QScreen *screen : qApp->screens()) { if (screen && screen->handle() && screen->handle()->cursor()) { const QMouseEvent event(type, QPointF(), QPointF(), pointF, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); screen->handle()->cursor()->pointerEvent(event); } } } QWaylandShellSurface *DWaylandShellManager::createShellSurface(QWaylandShellIntegration *self, QWaylandWindow *window) { auto surface = HookCall(self, &QWaylandShellIntegration::createShellSurface, window); HookOverride(surface, &QWaylandShellSurface::sendProperty, DWaylandShellManager::sendProperty); HookOverride(surface, &QWaylandShellSurface::wantsDecorations, DWaylandShellManager::disableClientDecorations); HookOverride(window, &QPlatformWindow::setGeometry, DWaylandShellManager::setGeometry); HookOverride(window, &QPlatformWindow::requestActivateWindow, DWaylandShellManager::requestActivateWindow); HookOverride(window, &QPlatformWindow::frameMargins, DWaylandShellManager::frameMargins); HookOverride(window, &QPlatformWindow::setWindowFlags, DWaylandShellManager::setWindowFlags); onShellSurfaceCreated(surface); // 设置窗口位置, 默认都需要设置,同时判断如果窗口并没有移动过,则不需要再设置位置,而是由窗管默认平铺显示 bool bSetPosition = true; QWidgetWindow *widgetWin = static_cast(window->window()); if (widgetWin->inherits("QWidgetWindow") && widgetWin->widget()) { if (!widgetWin->widget()->testAttribute(Qt::WA_Moved)) { bSetPosition = false; } // 1. dabstractdialog 的 showevent 中会主动move到屏幕居中的位置, 即 setAttribute(Qt::WA_Moved)。 // 2. 有 parent(ddialog dlg(this)) 的 window 窗管会主动调整位置,没有设置parent的才需要插件调整位置 如 ddialog dlg; if (window->transientParent() && !widgetWin->widget()->inherits("QMenu")) { bSetPosition = false; } } if (bSetPosition) { //QWaylandWindow对应surface的geometry,如果使用QWindow会导致缩放后surface坐标错误。 window->sendProperty(_DWAYALND_ "window-position", window->geometry().topLeft()); } for (const QByteArray &pname : widgetWin->dynamicPropertyNames()) { if (Q_LIKELY(!CHECK_PREFIX(pname))) continue; // 将窗口自定义属性记录到wayland window property中 window->sendProperty(pname, widgetWin->property(pname.constData())); } //将拖拽图标窗口置顶,QShapedPixmapWindow是Qt中拖拽图标窗口专用类 if (widgetWin->inherits("QShapedPixmapWindow")) { window->sendProperty(QStringLiteral(_DWAYALND_ "staysontop"), true); } return surface; } void DWaylandShellManager::createKWaylandShell(quint32 name, quint32 version) { kwayland_shell = registry()->createPlasmaShell(name, version, registry()->parent()); Q_ASSERT_X(kwayland_shell, "PlasmaShell", "Registry create PlasmaShell failed."); for (QPointer lw_window : send_property_window_list) { if (!lw_window) { continue; } const QVariantMap &properites = lw_window->properties(); // 当kwayland_shell被创建后,找到以_d_dwayland_开头的扩展属性将其设置一遍 for (auto p = properites.cbegin(); p != properites.cend(); ++p) { if (CHECK_PREFIX(p.key())) sendProperty(lw_window->shellSurface(), p.key(), p.value()); } } send_property_window_list.clear(); } void DWaylandShellManager::createKWaylandSSD(quint32 name, quint32 version) { kwayland_ssd = registry()->createServerSideDecorationManager(name, version, registry()->parent()); Q_ASSERT_X(kwayland_ssd, "ServerSideDecorationManager", "KWayland Registry ServerSideDecorationManager failed."); } void DWaylandShellManager::createDDEShell(quint32 name, quint32 version) { ddeShell = registry()->createDDEShell(name, version, registry()->parent()); Q_ASSERT_X(ddeShell, "DDEShell", "Registry create DDEShell failed."); } void DWaylandShellManager::createDDESeat(quint32 name, quint32 version) { kwayland_dde_seat = registry()->createDDESeat(name, version, registry()->parent()); Q_ASSERT_X(kwayland_dde_seat, "DDESeat", "Registry create DDESeat failed."); } /* * @brief createStrut 创建dock区域,仅dock使用 * @param registry * @param name * @param version */ void DWaylandShellManager::createStrut(quint32 name, quint32 version) { kwayland_strut = registry()->createStrut(name, version, registry()->parent()); Q_ASSERT_X(kwayland_strut, "strut", "Registry create strut failed."); } void DWaylandShellManager::createDDEKeyboard() { //create dde keyboard Q_ASSERT(kwayland_dde_seat); kwayland_dde_keyboard = kwayland_dde_seat->createDDEKeyboard(registry()->parent()); Q_ASSERT(kwayland_dde_keyboard); //刷新时间队列,等待kwin反馈消息 if (wlDisplay){ wl_display_roundtrip(wlDisplay); } } void DWaylandShellManager::createDDEFakeInput() { kwayland_dde_fake_input = registry()->createFakeInput(registry()->interface(Registry::Interface::FakeInput).name, registry()->interface(Registry::Interface::FakeInput).version); if (!kwayland_dde_fake_input || !kwayland_dde_fake_input->isValid()) { qCWarning(dwlp) << "fake input create failed."; return; } // 打开设置光标位置的开关 kwayland_dde_fake_input->authenticate("dtk", QString("set cursor pos")); } void DWaylandShellManager::createDDEPointer() { //create dde pointer Q_ASSERT(kwayland_dde_seat); kwayland_dde_pointer = kwayland_dde_seat->createDDePointer(); Q_ASSERT(kwayland_dde_pointer); //向kwin发送获取全局坐标请求 kwayland_dde_pointer->getMotion(); //刷新时间队列,等待kwin反馈消息 if (wlDisplay) { wl_display_roundtrip(wlDisplay); } //更新一次全局坐标 pointerEvent(kwayland_dde_pointer->getGlobalPointerPos(), QEvent::Move); // mouse move static bool isTouchMotion = false; QObject::connect(kwayland_dde_pointer, &DDEPointer::motion, [] (const QPointF &posF) { if (isTouchMotion) return; pointerEvent(posF, QEvent::Move); }); // 适配触屏 // 1.25倍的缩放还是需要单独处理 static QPointF releasePos; kwayland_dde_touch = kwayland_dde_seat->createDDETouch(); QObject::connect(kwayland_dde_touch, &DDETouch::touchDown, [=] (int32_t kwaylandId, const QPointF &pos) { if (kwaylandId != 0) { return; } releasePos = pos; setCursorPoint(pos); pointerEvent(pos, QEvent::MouseButtonPress); }); QObject::connect(kwayland_dde_touch, &DDETouch::touchMotion, [=] (int32_t kwaylandId, const QPointF &pos) { if (kwaylandId != 0) { return; } isTouchMotion = true; pointerEvent(pos, QEvent::Move); setCursorPoint(pos); releasePos = pos; }); QObject::connect(kwayland_dde_touch, &DDETouch::touchUp, [=] (int32_t kwaylandId) { if (kwaylandId != 0) { return; } // 和 motion 的最后一个位置相等, 无需再更新 if (isTouchMotion) { isTouchMotion = false; return; } setCursorPoint(releasePos); pointerEvent(releasePos, QEvent::MouseButtonRelease); }); } void DWaylandShellManager::createBlurManager(quint32 name, quint32 version) { kwayland_blur_manager = registry()->createBlurManager(name, version); if (!kwayland_blur_manager) { qCWarning(dwlp) << "kwayland_blur_manager create failed."; return; } } void DWaylandShellManager::createCompositor(quint32 name, quint32 version) { kwayland_compositor = registry()->createCompositor(name, version); if (!kwayland_compositor) { qCWarning(dwlp) << "kwayland_compositor create failed."; return; } } void DWaylandShellManager::createSurface() { if (!kwayland_compositor) { qCWarning(dwlp) << "kwayland_compositor is invalid."; return; } kwayland_surface = kwayland_compositor->createSurface(); if (!kwayland_surface) { qCWarning(dwlp) << "kwayland_surface create failed."; return; } } void DWaylandShellManager::createPlasmaWindowManagement(KWayland::Client::Registry *registry, quint32 name, quint32 version) { kwayland_manage = registry->createPlasmaWindowManagement(name, version, registry->parent()); } void DWaylandShellManager::requestActivateWindow(QPlatformWindow *self) { HookCall(self, &QPlatformWindow::requestActivateWindow); auto qwlWindow = static_cast(self); if (self->QPlatformWindow::parent() || !ddeShell || !qwlWindow) { return; } if (auto *dde_shell_surface = ensureDDEShellSurface(qwlWindow->shellSurface())) { dde_shell_surface->requestActive(); } } /*插件把qt自身的标题栏去掉了,使用的是窗管的标题栏,但是qtwaylandwindow每次传递坐标给kwin的时候, * 都计算了(3, 30)的偏移,导致每次设置窗口属性的时候,窗口会下移,这个(3, 30)的偏移其实是qt自身 * 标题栏计算的偏移量,我们uos桌面不能带入这个偏移量 */ QMargins DWaylandShellManager::frameMargins(QPlatformWindow *self) { Q_UNUSED(self) return QMargins(0, 0, 0, 0); } void DWaylandShellManager::setWindowFlags(QPlatformWindow *self, Qt::WindowFlags flags) { HookCall(self, &QPlatformWindow::setWindowFlags, flags); auto qwlWindow = static_cast(self); if (!qwlWindow) { return; } qCDebug(dwlp) << "Qt::WindowStaysOnTopHint: " << flags.testFlag(Qt::WindowStaysOnTopHint); setWindowStaysOnTop(qwlWindow->shellSurface(), flags.testFlag(Qt::WindowStaysOnTopHint)); } void DWaylandShellManager::handleGeometryChange(QWaylandShellSurface *shellSurface) { auto ddeShellSurface = ensureDDEShellSurface(shellSurface); if (!ddeShellSurface || !shellSurface->window()) { return; } QObject::connect(ddeShellSurface, &DDEShellSurface::geometryChanged, shellSurface->window(), [=] (const QRect &geom) { QRect newRect(geom.topLeft(), shellSurface->window()->geometry().size()); QWindowSystemInterface::handleGeometryChange(shellSurface->window()->window(), newRect); }); } typedef DDEShellSurface KCDFace; Qt::WindowStates getwindowStates(KCDFace *surface) { // handleWindowStateChanged 不能传 WindowActive 状态,单独处理 Qt::WindowStates state = Qt::WindowNoState; if (surface->isMinimized()) state = Qt::WindowMinimized; else if (surface->isFullscreen()) state = Qt::WindowFullScreen; else if (surface->isMaximized()) state = Qt::WindowMaximized; return state; } void DWaylandShellManager::handleWindowStateChanged(QWaylandShellSurface *shellSurface) { if (!shellSurface) { qCWarning(dwlp) << "shellSurface is null"; return; } QWaylandWindow *window = shellSurface->window(); auto ddeShellSurface = ensureDDEShellSurface(shellSurface); if (!ddeShellSurface) return; #define d_oldState QStringLiteral("_d_oldState") #define STATE_CHANGED(sig) \ QObject::connect(ddeShellSurface, &KCDFace::sig, window, [window, ddeShellSurface](){ \ qCDebug(dwlp) << "==== "#sig ; \ const Qt::WindowStates &newState = getwindowStates(ddeShellSurface); \ const int &oldState = window->property(d_oldState).toInt(); \ QWindowSystemInterface::handleWindowStateChanged(window->window(), newState, oldState); \ window->setProperty(d_oldState, static_cast(newState)); \ }) window->setProperty(d_oldState, (int)getwindowStates(ddeShellSurface)); STATE_CHANGED(minimizedChanged); STATE_CHANGED(maximizedChanged); STATE_CHANGED(fullscreenChanged); STATE_CHANGED(activeChanged); QObject::connect(ddeShellSurface, &KCDFace::activeChanged, window, [window, ddeShellSurface](){ if (QWindow *w = ddeShellSurface->isActive() ? window->window() : nullptr) #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) QWindowSystemInterface::handleWindowActivated(w, Qt::FocusReason::ActiveWindowFocusReason); #else QWindowSystemInterface::handleFocusWindowChanged(w, Qt::FocusReason::ActiveWindowFocusReason); #endif }); #define SYNC_FLAG(sig, enableFunc, flag) \ QObject::connect(ddeShellSurface, &KCDFace::sig, window, [window, ddeShellSurface](){ \ qCDebug(dwlp) << "==== "#sig << (enableFunc); \ window->window()->setFlag(flag, enableFunc); \ }) // SYNC_FLAG(keepAboveChanged, ddeShellSurface->isKeepAbove(), Qt::WindowStaysOnTopHint); QObject::connect(ddeShellSurface, &KCDFace::keepAboveChanged, window, [window, ddeShellSurface](){ bool isKeepAbove = ddeShellSurface->isKeepAbove(); qCDebug(dwlp) << "==== keepAboveChanged" << isKeepAbove; window->window()->setProperty(_DWAYALND_ "staysontop", isKeepAbove); }); SYNC_FLAG(keepBelowChanged, ddeShellSurface->isKeepBelow(), Qt::WindowStaysOnBottomHint); SYNC_FLAG(minimizeableChanged, ddeShellSurface->isMinimizeable(), Qt::WindowMinimizeButtonHint); SYNC_FLAG(maximizeableChanged, ddeShellSurface->isMinimizeable(), Qt::WindowMaximizeButtonHint); SYNC_FLAG(closeableChanged, ddeShellSurface->isCloseable(), Qt::WindowCloseButtonHint); SYNC_FLAG(fullscreenableChanged, ddeShellSurface->isFullscreenable(), Qt::WindowFullscreenButtonHint); // TODO: not support yet //SYNC_FLAG(movableChanged, ddeShellSurface->isMovable(), Qt::??); //SYNC_FLAG(resizableChanged, ddeShellSurface->isResizable(), Qt::??); //SYNC_FLAG(acceptFocusChanged, ddeShellSurface->isAcceptFocus(), Qt::??); //SYNC_FLAG(modalityChanged, ddeShellSurface->isModal(), Qt::??); } /* * @brief setWindowStaysOnTop 设置窗口置顶 * @param surface * @param state true:设置窗口置顶,false:取消置顶 */ void DWaylandShellManager::setWindowStaysOnTop(QWaylandShellSurface *surface, const bool state) { if (auto *dde_shell_surface = ensureDDEShellSurface(surface)) { dde_shell_surface->requestKeepAbove(state); } } /* * @brief setDockStrut 设置窗口有效区域 * @param surface * @param var[0]:dock位置 var[1]:dock高度或者宽度 var[2]:start值 var[3]:end值 */ void DWaylandShellManager::setDockStrut(QWaylandShellSurface *surface, const QVariant var) { deepinKwinStrut dockStrut; switch (var.toList()[0].toInt()) { case 0: dockStrut.left = var.toList()[1].toInt(); dockStrut.left_start_y = var.toList()[2].toInt(); dockStrut.left_end_y = var.toList()[3].toInt(); break; case 1: dockStrut.top = var.toList()[1].toInt(); dockStrut.top_start_x = var.toList()[2].toInt(); dockStrut.top_end_x = var.toList()[3].toInt(); break; case 2: dockStrut.right = var.toList()[1].toInt(); dockStrut.right_start_y = var.toList()[2].toInt(); dockStrut.right_end_y = var.toList()[3].toInt(); break; case 3: dockStrut.bottom = var.toList()[1].toInt(); dockStrut.bottom_start_x = var.toList()[2].toInt(); dockStrut.bottom_end_x = var.toList()[3].toInt(); break; default: break; } kwayland_strut->setStrutPartial(getWindowWLSurface(surface->window()), dockStrut); } /* * @brief setDockAppItemMinimizedGeometry 设置驻留任务栏应用窗口最小化的位置信息 * @param surface * @param var[0]:应用 窗口Id * var[1]:app window x * var[2]:app window y * var[3]:app window width * var[4]:app window height */ void DWaylandShellManager::setDockAppItemMinimizedGeometry(QWaylandShellSurface *surface, const QVariant var) { if (!surface) { return; } for (auto w : kwayland_manage->windows()){ if (w->windowId() == var.toList()[0].toUInt()) { auto x = var.toList()[1].toInt(); auto y = var.toList()[2].toInt(); auto width = var.toList()[3].toInt(); auto height = var.toList()[4].toInt(); QRect r(QPoint(x, y), QSize(width, height)); if (w) { auto s = ensureSurface(surface->window()); if (!s) { qCWarning(dwlp) << "invalid surface"; return; } w->setMinimizedGeometry(s, r); } return; } } } void DWaylandShellManager::onShellSurfaceCreated(QWaylandShellSurface *shellSurface) { handleGeometryChange(shellSurface); handleWindowStateChanged(shellSurface); createServerDecoration(shellSurface); } /* * @brief setCursorPoint 设置光标在屏幕中的绝对位置 * @param pos */ void DWaylandShellManager::setCursorPoint(QPointF pos) { if (!kwayland_dde_fake_input) { qCCritical(dwlp) << "kwayland_dde_fake_input is nullptr"; return; } if (!kwayland_dde_fake_input->isValid()) { qCCritical(dwlp) << "kwayland_dde_fake_input is invalid"; return; } kwayland_dde_fake_input->requestPointerMoveAbsolute(pos); } void DWaylandShellManager::setEnableBlurWidow(QWaylandWindow *wlWindow, const QVariant &value) { auto surface = ensureSurface(wlWindow); if (value.toBool()) { auto blur = ensureBlur(surface, surface); if (!blur) { qCWarning(dwlp) << "invalid blur"; return; } auto region = ensureRegion(surface); if (!region) { qCWarning(dwlp) << "invalid region"; return; } blur->setRegion(region); blur->commit(); if (!kwayland_surface) { qCWarning(dwlp) << "invalid kwayland_surface"; return; } kwayland_surface->commit(Surface::CommitFlag::None); } else { if (!kwayland_blur_manager) { qCWarning(dwlp) << "invalid kwayland_blur_manager"; return; } kwayland_blur_manager->removeBlur(surface); if (!kwayland_surface) { qCWarning(dwlp) << "invalid kwayland_surface"; return; } kwayland_surface->commit(Surface::CommitFlag::None); // 取消模糊效果的更新需要主动调用应用侧的窗口 if (QWidgetWindow *widgetWin = static_cast(wlWindow->window())) { if (auto widget = widgetWin->widget()) { widget->update(); } } } } void DWaylandShellManager::updateWindowBlurAreasForWM(QWaylandWindow *wlWindow, const QString &name, const QVariant &value) { if (!wlWindow->waylandScreen()) { return; } auto screen = wlWindow->waylandScreen()->screen(); if (!screen) { return; } auto devicePixelRatio = screen->devicePixelRatio(); auto surface = ensureSurface(wlWindow); if (!surface) { qCWarning(dwlp) << "invalid surface"; return; } auto blur = ensureBlur(surface, surface); if (!blur) { qCWarning(dwlp) << "invalid blur"; return; } auto region = kwayland_compositor->createRegion(surface); if (!name.compare(windowBlurAreas)) { const QVector &tmpV = qvariant_cast>(value); const QVector &blurAreas = *(reinterpret_cast*>(&tmpV)); if (blurAreas.isEmpty()) { qCWarning(dwlp) << "invalid BlurAreas"; return; } for (auto ba : blurAreas) { ba *= devicePixelRatio; QPainterPath path; path.addRoundedRect(ba.x, ba.y, ba.width, ba.height, ba.xRadius, ba.yRaduis); region->add(path.toFillPolygon().toPolygon()); } } else { const QList paths = qvariant_cast>(value); if (paths.isEmpty()) { qCWarning(dwlp) << "invalid BlurPaths"; return; } for (auto path : paths) { path *= devicePixelRatio; QPolygon polygon(path.toFillPolygon().toPolygon()); region->add(polygon); } } blur->setRegion(region); blur->commit(); kwayland_surface->commit(Surface::CommitFlag::None); } bool DWaylandShellManager::disableClientDecorations(QWaylandShellSurface *surface) { Q_UNUSED(surface) // 禁用qtwayland自带的bradient边框(太丑了) return false; } void DWaylandShellManager::createServerDecoration(QWaylandShellSurface *shellSurface) { if (!shellSurface) { qCWarning(dwlp) << "shellSurface is null"; return; } QWaylandWindow *window = shellSurface->window(); // 如果kwayland的server窗口装饰已转变完成,则为窗口创建边框 if (!kwayland_ssd) { qDebug()<<"====kwayland_ssd creat failed"; return; } // 通过窗口属性控制是否显示最小化和最大化按钮 if (shellSurface) { auto *dde_shell_surface = ensureDDEShellSurface(shellSurface); if (dde_shell_surface) { if (!(window->window()->flags() & Qt::WindowMinimizeButtonHint)) { dde_shell_surface->requestMinizeable(false); } if (!(window->window()->flags() & Qt::WindowMaximizeButtonHint)) { dde_shell_surface->requestMaximizeable(false); } if ((window->window()->flags() & Qt::WindowStaysOnTopHint)) { dde_shell_surface->requestKeepAbove(true); } if ((window->window()->flags() & Qt::WindowDoesNotAcceptFocus)) { dde_shell_surface->requestAcceptFocus(false); } if (window->window()->modality() != Qt::NonModal) { dde_shell_surface->requestModal(true); } } } bool decoration = false; switch (window->window()->type()) { case Qt::Window: case Qt::Widget: case Qt::Dialog: case Qt::Tool: case Qt::Drawer: decoration = true; break; default: break; } if (window->window()->flags() & Qt::FramelessWindowHint) decoration = false; if (window->window()->flags() & Qt::BypassWindowManagerHint) decoration = false; qCDebug(dwlp) << "create decoration ?" << decoration; if (!decoration) return; auto *surface = getWindowWLSurface(window); if (!surface) return; // 创建由kwin server渲染的窗口边框对象 if (auto ssd = kwayland_ssd->create(surface, shellSurface)) { ssd->requestMode(ServerSideDecoration::Mode::Server); } } } qt5platform-plugins-5.7.12/wayland/wayland-shell/dwaylandshellmanager.h000066400000000000000000000111561476226662200263260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DWaylandShellManager_H #define DWaylandShellManager_H #include "vtablehook.h" #define private public #include "QtWaylandClient/private/qwaylandintegration_p.h" #include "QtWaylandClient/private/qwaylandshellintegrationplugin_p.h" #include "QtWaylandClient/private/qwaylandshellintegration_p.h" #include "QtWaylandClient/private/qwaylandshellsurface_p.h" #include "QtWaylandClient/private/qwaylandwindow_p.h" #include "QtWaylandClient/private/qwaylandcursor_p.h" #include "QtWaylandClient/private/qwaylandscreen_p.h" #undef private #ifndef D_DEEPIN_IS_DWAYLAND #include #include #include #include #include #include #include #include #include #include #include #include #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #include #include #include #include #include #include DPP_USE_NAMESPACE using namespace KWayland::Client; namespace QtWaylandClient { class DWaylandShellManager { DWaylandShellManager(); ~DWaylandShellManager(); Registry *m_registry = nullptr; public: static DWaylandShellManager *instance() { static DWaylandShellManager manager; return &manager; } static Registry *registry() { return instance()->m_registry; } static void sendProperty(QWaylandShellSurface *self, const QString &name, const QVariant &value); static void requestActivateWindow(QPlatformWindow *self); static bool disableClientDecorations(QWaylandShellSurface *surface); static QMargins frameMargins(QPlatformWindow *self); static void setWindowFlags(QPlatformWindow *self, Qt::WindowFlags flags); static void createServerDecoration(QWaylandShellSurface *shellSurface); static void setGeometry(QPlatformWindow *self, const QRect &rect); static void pointerEvent(const QPointF &pointF, QEvent::Type type); static QWaylandShellSurface *createShellSurface(QWaylandShellIntegration *self, QWaylandWindow *window); static void createKWaylandShell(quint32 name, quint32 version); static void createKWaylandSSD(quint32 name, quint32 version); static void createDDEShell(quint32 name, quint32 version); static void createDDESeat(quint32 name, quint32 version); static void createStrut(quint32 name, quint32 version); static void createDDEPointer(); static void createDDEKeyboard(); static void createDDEFakeInput(); static void createBlurManager(quint32 name, quint32 version); static void createCompositor(quint32 name, quint32 version); static void createSurface(); static void createPlasmaWindowManagement(KWayland::Client::Registry *registry, quint32 name, quint32 version); static void handleGeometryChange(QWaylandShellSurface *shellSurface); static void handleWindowStateChanged(QWaylandShellSurface *shellSurface); static void setWindowStaysOnTop(QWaylandShellSurface *surface, const bool state); static void setDockStrut(QWaylandShellSurface *surface, const QVariant var); static void setCursorPoint(QPointF pos); static void setEnableBlurWidow(QWaylandWindow *wlWindow, const QVariant &value); static void updateWindowBlurAreasForWM(QWaylandWindow *wlWindow, const QString &name, const QVariant &value); static void setDockAppItemMinimizedGeometry(QWaylandShellSurface *surface, const QVariant var); static void onShellSurfaceCreated(QWaylandShellSurface *shellSurface); private: // 用于记录设置过以_DWAYALND_开头的属性,当kwyalnd_shell对象创建以后要使这些属性生效 static QList> send_property_window_list; }; } #endif // DWaylandShellManager_H qt5platform-plugins-5.7.12/wayland/wayland-shell/kwayland-shell.json000066400000000000000000000000441476226662200255730ustar00rootroot00000000000000{ "Keys":[ "kwayland-shell" ] } qt5platform-plugins-5.7.12/wayland/wayland-shell/main.cpp000066400000000000000000000112441476226662200234150ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef USE_DEEPIN_WAYLAND #include "QtWaylandClient/private/qwaylandintegration_p.h" #include "QtWaylandClient/private/qwaylandshellintegrationplugin_p.h" namespace QtWaylandClient { class QKWaylandShellIntegrationPlugin : public QWaylandShellIntegrationPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "kwayland-shell.json") public: QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override { Q_UNUSED(key); Q_UNUSED(paramList); return nullptr; } }; } #else #include "vtablehook.h" #include "dwaylandshellmanager.h" #define private public #include "QtWaylandClient/private/qwaylandintegration_p.h" #include "QtWaylandClient/private/qwaylandshellintegrationplugin_p.h" #include "QtWaylandClient/private/qwaylandshellintegration_p.h" #include "QtWaylandClient/private/qwaylandshellsurface_p.h" #include "QtWaylandClient/private/qwaylandwindow_p.h" #undef private #ifndef D_DEEPIN_IS_DWAYLAND #include #include #include #include #else #include #include #include #include #endif #include #include #include #include #include #include // 用于窗口设置和dwayland相关的特殊属性的前缀 // 以_d_dwayland_开头的属性需要做特殊处理,一般是用于和kwayland的交互 #define _DWAYALND_ "_d_dwayland_" #define platformNativeDisplay \ QGuiApplication::platformNativeInterface()-> \ nativeResourceForIntegration(QByteArrayLiteral("display")) DPP_USE_NAMESPACE namespace QtWaylandClient { class QKWaylandShellIntegrationPlugin : public QWaylandShellIntegrationPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "kwayland-shell.json") public: QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override; }; QWaylandShellIntegration *QKWaylandShellIntegrationPlugin::create(const QString &key, const QStringList ¶mList) { Q_UNUSED(key) Q_UNUSED(paramList) Registry *registry = DWaylandShellManager::registry(); connect(registry, &Registry::plasmaShellAnnounced, &DWaylandShellManager::createKWaylandShell); connect(registry, &Registry::serverSideDecorationManagerAnnounced, &DWaylandShellManager::createKWaylandSSD); //创建ddeshell connect(registry, &Registry::ddeShellAnnounced, &DWaylandShellManager::createDDEShell); //创建ddeseat connect(registry, &Registry::ddeSeatAnnounced, &DWaylandShellManager::createDDESeat); connect(registry, &Registry::interfacesAnnounced, [] { DWaylandShellManager::createDDEPointer(); DWaylandShellManager::createDDEKeyboard(); DWaylandShellManager::createDDEFakeInput(); }); connect(registry, &Registry::strutAnnounced, &DWaylandShellManager::createStrut); connect(registry, &Registry::blurAnnounced, [](quint32 name, quint32 version) { DWaylandShellManager::createBlurManager(name, version); }); connect(registry, &Registry::compositorAnnounced, [](quint32 name, quint32 version){ DWaylandShellManager::createCompositor(name, version); DWaylandShellManager::createSurface(); }); connect(registry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced, [registry](quint32 name, quint32 version) { DWaylandShellManager::createPlasmaWindowManagement(registry, name, version); }); wl_display *wlDisplay = reinterpret_cast(platformNativeDisplay); registry->create(wlDisplay); registry->setup(); wl_display_roundtrip(wlDisplay); auto wayland_integration = static_cast(QGuiApplicationPrivate::platformIntegration()); QString shellVersion = registry->hasInterface(Registry::Interface::XdgShellUnstableV6) ? "xdg-shell-v6" : "xdg-shell"; QWaylandShellIntegration *shell = wayland_integration->createShellIntegration(shellVersion); if (!shell) { qInfo() << "Failed to create kwayland-shell and the shell is nullptr."; return nullptr; } HookOverride(shell, &QWaylandShellIntegration::createShellSurface, DWaylandShellManager::createShellSurface); return shell; } } #include "main.moc" #endif qt5platform-plugins-5.7.12/wayland/wayland-shell/qt5dwayland-plugin_global.h000066400000000000000000000006541476226662200272120ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef QT5DWAYLANDPLUGIN_GLOBAL_H #define QT5DWAYLANDPLUGIN_GLOBAL_H #include #if defined(QT5DWAYLANDPLUGIN_LIBRARY) # define QT5DWAYLANDPLUGINSHARED_EXPORT Q_DECL_EXPORT #else # define QT5DWAYLANDPLUGINSHARED_EXPORT Q_DECL_IMPORT #endif #endif // QT5DWAYLANDPLUGIN_GLOBAL_H qt5platform-plugins-5.7.12/wayland/wayland-shell/qt5dwaylandplugin.cpp000066400000000000000000000003141476226662200261410ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "qt5dwaylandplugin.h" Qt5dwaylandplugin::Qt5dwaylandplugin() { } qt5platform-plugins-5.7.12/wayland/wayland-shell/qt5dwaylandplugin.h000066400000000000000000000005361476226662200256140ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef QT5DWAYLANDPLUGIN_H #define QT5DWAYLANDPLUGIN_H #include "qt5dwayland-plugin_global.h" class QT5DWAYLANDPLUGINSHARED_EXPORT Qt5dwaylandplugin { public: Qt5dwaylandplugin(); }; #endif // QT5DWAYLANDPLUGIN_H qt5platform-plugins-5.7.12/wayland/wayland-shell/wayland-shell.cmake000066400000000000000000000010121476226662200255230ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later find_package(ECM REQUIRED 1.0.0) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) find_package(DWayland) if(DWayland_FOUND) add_definitions(-DD_DEEPIN_IS_DWAYLAND) set(COMMON_LIBS Deepin::WaylandClient) message("Using the DWayland module") else() find_package(KF5Wayland REQUIRED) set(COMMON_LIBS KF5::WaylandClient) message("Using the KF5Wayland module") endif() qt5platform-plugins-5.7.12/xcb/000077500000000000000000000000001476226662200163345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/3rdparty/000077500000000000000000000000001476226662200201045ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/3rdparty/clientwin.c000066400000000000000000000164151476226662200222530ustar00rootroot00000000000000/* * Copyright 2007 Kim woelders * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #include #include #include #include #include "clientwin.h" #include "dsimple.h" #define Bool int #define False 0 #define True 1 static xcb_atom_t atom_wm_state = XCB_ATOM_NONE; #ifdef __cplusplus extern "C" { #endif /* * Check if window has given property */ static Bool Window_Has_Property(xcb_connection_t *dpy, xcb_window_t win, xcb_atom_t atom) { xcb_get_property_cookie_t prop_cookie; xcb_get_property_reply_t *prop_reply; prop_cookie = xcb_get_property(dpy, False, win, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, 0); prop_reply = xcb_get_property_reply(dpy, prop_cookie, NULL); if (prop_reply) { xcb_atom_t reply_type = prop_reply->type; free(prop_reply); if (reply_type != XCB_NONE) return True; } return False; } /* * Check if window is viewable */ static Bool Window_Is_Viewable(xcb_connection_t *dpy, xcb_window_t win) { Bool ok = False; xcb_get_window_attributes_cookie_t attr_cookie; xcb_get_window_attributes_reply_t *xwa; attr_cookie = xcb_get_window_attributes(dpy, win); xwa = xcb_get_window_attributes_reply(dpy, attr_cookie, NULL); if (xwa) { ok = (xwa->_class == XCB_WINDOW_CLASS_INPUT_OUTPUT) && (xwa->map_state == XCB_MAP_STATE_VIEWABLE); free(xwa); } return ok; } /* * Find a window that has WM_STATE set in the window tree below win. * Unmapped/unviewable windows are not considered valid matches. * Children are searched in top-down stacking order. * The first matching window is returned, None if no match is found. */ static xcb_window_t Find_Client_In_Children(xcb_connection_t *dpy, xcb_window_t win) { xcb_query_tree_cookie_t qt_cookie; xcb_query_tree_reply_t *tree; xcb_window_t *children; int n_children; int i; qt_cookie = xcb_query_tree(dpy, win); tree = xcb_query_tree_reply(dpy, qt_cookie, NULL); if (!tree) return XCB_WINDOW_NONE; n_children = xcb_query_tree_children_length(tree); if (!n_children) { free(tree); return XCB_WINDOW_NONE; } children = xcb_query_tree_children(tree); /* Check each child for WM_STATE and other validity */ win = XCB_WINDOW_NONE; for (i = n_children - 1; i >= 0; i--) { if (!Window_Is_Viewable(dpy, children[i])) { /* Don't bother descending into this one */ children[i] = XCB_WINDOW_NONE; continue; } if (!Window_Has_Property(dpy, children[i], atom_wm_state)) continue; /* Got one */ win = children[i]; goto done; } /* No children matched, now descend into each child */ for (i = (int)n_children - 1; i >= 0; i--) { if (children[i] == XCB_WINDOW_NONE) continue; win = Find_Client_In_Children(dpy, children[i]); if (win != XCB_WINDOW_NONE) break; } done: free(tree); /* includes children */ return win; } /* * Find virtual roots (_NET_VIRTUAL_ROOTS) */ static xcb_window_t * Find_Roots(xcb_connection_t *dpy, xcb_window_t root, unsigned int *num) { xcb_atom_t atom_virtual_root; xcb_get_property_cookie_t prop_cookie; xcb_get_property_reply_t *prop_reply; xcb_window_t *prop_ret = NULL; *num = 0; atom_virtual_root = Get_Atom(dpy, "_NET_VIRTUAL_ROOTS"); if (atom_virtual_root == XCB_ATOM_NONE) return NULL; prop_cookie = xcb_get_property(dpy, False, root, atom_virtual_root, XCB_ATOM_WINDOW, 0, 0x7fffffff); prop_reply = xcb_get_property_reply(dpy, prop_cookie, NULL); if (!prop_reply) return NULL; if ((prop_reply->value_len > 0) && (prop_reply->type == XCB_ATOM_WINDOW) && (prop_reply->format == 32)) { int length = xcb_get_property_value_length(prop_reply); prop_ret = malloc((size_t)length); if (prop_ret) { memcpy(prop_ret, xcb_get_property_value(prop_reply), (size_t)length); *num = prop_reply->value_len; } } free(prop_reply); return prop_ret; } /* * Find child window at pointer location */ static xcb_window_t Find_Child_At_Pointer(xcb_connection_t *dpy, xcb_window_t win) { xcb_window_t child_return = XCB_WINDOW_NONE; xcb_query_pointer_cookie_t qp_cookie; xcb_query_pointer_reply_t *qp_reply; qp_cookie = xcb_query_pointer(dpy, win); qp_reply = xcb_query_pointer_reply(dpy, qp_cookie, NULL); if (qp_reply) { child_return = qp_reply->child; free(qp_reply); } return child_return; } /* * Find client window at pointer location * * root is the root window. * subwin is the subwindow reported by a ButtonPress event on root. * * If the WM uses virtual roots subwin may be a virtual root. * If so, we descend the window stack at the pointer location and assume the * child is the client or one of its WM frame windows. * This will of course work only if the virtual roots are children of the real * root. */ xcb_window_t Find_Client(xcb_connection_t *dpy, xcb_window_t root, xcb_window_t subwin) { xcb_window_t *roots; unsigned int i, n_roots; xcb_window_t win; /* Check if subwin is a virtual root */ roots = Find_Roots(dpy, root, &n_roots); for (i = 0; i < n_roots; i++) { if (subwin != roots[i]) continue; win = Find_Child_At_Pointer(dpy, subwin); if (win == XCB_WINDOW_NONE) { free(roots); return subwin; /* No child - Return virtual root. */ } subwin = win; break; } free(roots); if (atom_wm_state == XCB_ATOM_NONE) { atom_wm_state = Get_Atom(dpy, "WM_STATE"); if (atom_wm_state == XCB_ATOM_NONE) return subwin; } /* Check if subwin has WM_STATE */ if (Window_Has_Property(dpy, subwin, atom_wm_state)) return subwin; /* Attempt to find a client window in subwin's children */ win = Find_Client_In_Children(dpy, subwin); if (win != XCB_WINDOW_NONE) return win; /* Found a client */ /* Did not find a client */ return subwin; } #ifdef __cplusplus } #endif qt5platform-plugins-5.7.12/xcb/3rdparty/clientwin.h000066400000000000000000000026561476226662200222620ustar00rootroot00000000000000/* * Copyright 2007 Kim woelders * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef _CLIENTWIN_H_ #define _CLIENTWIN_H_ #include #include #ifdef __cplusplus extern "C" { #endif extern xcb_window_t Find_Client(xcb_connection_t *dpy, xcb_window_t root, xcb_window_t target_win); #ifdef __cplusplus } #endif #endif qt5platform-plugins-5.7.12/xcb/3rdparty/dsimple.c000066400000000000000000000454541476226662200217210ustar00rootroot00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP 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. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ //#include "config.h" #include #include #ifdef USE_XCB_ICCCM #include #endif #include #include #include #include #include #include "clientwin.h" #include "dsimple.h" /* * Just_display: A group of routines designed to make the writing of simple * X11 applications which open a display but do not open * any windows much faster and easier. Unless a routine says * otherwise, it may be assumed to require program_name * to be already defined on entry. * * Written by Mark Lillibridge. Last updated 7/1/87 */ /* This stuff is defined in the calling program by dsimple.h */ const char *program_name = "unknown_program"; /* * Get_Display_Name (argc, argv) - return string representing display name * that would be used given the specified argument (i.e. if it's NULL, check * getenv("DISPLAY") - always returns a non-NULL pointer, though it may be * an unwritable constant, so is safe to printf() on platforms that crash * on NULL printf arguments. */ const char *Get_Display_Name(const char *display_name) { const char *name = display_name; if (!name) { name = getenv("DISPLAY"); if (!name) name = ""; } return (name); } /* * Setup_Display_And_Screen: This routine opens up the correct display (i.e., * it calls Get_Display_Name) and then stores a * pointer to it in dpy. The default screen * for this display is then stored in screen. */ void Setup_Display_And_Screen( const char *display_name, xcb_connection_t **dpy, /* MODIFIED */ xcb_screen_t **screen) /* MODIFIED */ { int screen_number, i, err; /* Open Display */ *dpy = xcb_connect(display_name, &screen_number); if ((err = xcb_connection_has_error(*dpy)) != 0) { switch (err) { case XCB_CONN_CLOSED_MEM_INSUFFICIENT: Fatal_Error("Failed to allocate memory in xcb_connect"); case XCB_CONN_CLOSED_PARSE_ERR: Fatal_Error("unable to parse display name \"%s\"", Get_Display_Name(display_name)); #ifdef XCB_CONN_CLOSED_INVALID_SCREEN case XCB_CONN_CLOSED_INVALID_SCREEN: Fatal_Error("invalid screen %d in display \"%s\"", screen_number, Get_Display_Name(display_name)); #endif default: Fatal_Error("unable to open display \"%s\"", Get_Display_Name(display_name)); } } if (screen) { /* find our screen */ const xcb_setup_t *setup = xcb_get_setup(*dpy); xcb_screen_iterator_t screen_iter = xcb_setup_roots_iterator(setup); int screen_count = xcb_setup_roots_length(setup); if (screen_count <= screen_number) { Fatal_Error("unable to access screen %d, max is %d", screen_number, screen_count - 1); } for (i = 0; i < screen_number; i++) xcb_screen_next(&screen_iter); *screen = screen_iter.data; } } /* * xcb equivalent of XCreateFontCursor */ static xcb_cursor_t Create_Font_Cursor(xcb_connection_t *dpy, uint16_t glyph) { static xcb_font_t cursor_font; xcb_cursor_t cursor; if (!cursor_font) { cursor_font = xcb_generate_id(dpy); xcb_open_font(dpy, cursor_font, strlen("cursor"), "cursor"); } cursor = xcb_generate_id(dpy); xcb_create_glyph_cursor(dpy, cursor, cursor_font, cursor_font, glyph, glyph + 1, 0, 0, 0, 0xffff, 0xffff, 0xffff); /* rgb, rgb */ return cursor; } /* * Routine to let user select a window using the mouse */ xcb_window_t Select_Window(xcb_connection_t *dpy, const xcb_screen_t *screen, int descend) { xcb_cursor_t cursor; xcb_generic_event_t *event; xcb_window_t target_win = XCB_WINDOW_NONE; xcb_window_t root = screen->root; int buttons = 0; xcb_generic_error_t *err; xcb_grab_pointer_cookie_t grab_cookie; xcb_grab_pointer_reply_t *grab_reply; /* Make the target cursor */ cursor = Create_Font_Cursor(dpy, XC_crosshair); /* Grab the pointer using target cursor, letting it room all over */ grab_cookie = xcb_grab_pointer(dpy, False, root, XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, root, cursor, XCB_TIME_CURRENT_TIME); grab_reply = xcb_grab_pointer_reply(dpy, grab_cookie, &err); if (grab_reply->status != XCB_GRAB_STATUS_SUCCESS) Fatal_Error("Can't grab the mouse."); /* Let the user select a window... */ while ((target_win == XCB_WINDOW_NONE) || (buttons != 0)) { /* allow one more event */ xcb_allow_events(dpy, XCB_ALLOW_SYNC_POINTER, XCB_TIME_CURRENT_TIME); xcb_flush(dpy); event = xcb_wait_for_event(dpy); if (event == NULL) Fatal_Error("Fatal IO error"); switch (event->response_type & 0x7f) { case XCB_BUTTON_PRESS: { xcb_button_press_event_t *bp = (xcb_button_press_event_t *)event; if (target_win == XCB_WINDOW_NONE) { target_win = bp->child; /* window selected */ if (target_win == XCB_WINDOW_NONE) target_win = root; } buttons++; break; } case XCB_BUTTON_RELEASE: if (buttons > 0) /* there may have been some down before we started */ buttons--; break; default: /* just discard all other events */ break; } free(event); } xcb_ungrab_pointer(dpy, XCB_TIME_CURRENT_TIME); /* Done with pointer */ if (!descend || (target_win == root)) return (target_win); target_win = Find_Client(dpy, root, target_win); return (target_win); } /* * Window_With_Name: routine to locate a window with a given name on a display. * If no window with the given name is found, 0 is returned. * If more than one window has the given name, the first * one found will be returned. Only top and its subwindows * are looked at. Normally, top should be the RootWindow. */ struct wininfo_cookies { xcb_get_property_cookie_t get_net_wm_name; xcb_get_property_cookie_t get_wm_name; xcb_query_tree_cookie_t query_tree; }; #ifndef USE_XCB_ICCCM #define xcb_icccm_get_wm_name(Dpy, Win) \ xcb_get_property(Dpy, False, Win, XCB_ATOM_WM_NAME, \ XCB_GET_PROPERTY_TYPE_ANY, 0, BUFSIZ) #endif static xcb_atom_t atom_net_wm_name, atom_utf8_string; #define xcb_get_net_wm_name(Dpy, Win) \ xcb_get_property(Dpy, False, Win, atom_net_wm_name, \ atom_utf8_string, 0, BUFSIZ) static xcb_window_t recursive_Window_With_Name( xcb_connection_t *dpy, xcb_window_t window, struct wininfo_cookies *cookies, const char *name, size_t namelen) { xcb_window_t *children; unsigned int nchildren; unsigned int i; xcb_window_t w = 0; xcb_generic_error_t *err; xcb_query_tree_reply_t *tree; struct wininfo_cookies *child_cookies; xcb_get_property_reply_t *prop; if (cookies->get_net_wm_name.sequence) { prop = xcb_get_property_reply(dpy, cookies->get_net_wm_name, &err); if (prop) { if (prop->type == atom_utf8_string) { const char *prop_name = xcb_get_property_value(prop); int prop_name_len = xcb_get_property_value_length(prop); /* can't use strcmp, since prop.name is not null terminated */ if ((namelen == (size_t)prop_name_len) && memcmp(prop_name, name, namelen) == 0) { w = window; } } free(prop); } else if (err) { if (err->response_type == 0) Print_X_Error(dpy, err); return 0; } } if (w) { xcb_discard_reply(dpy, cookies->get_wm_name.sequence); } else { #ifdef USE_XCB_ICCCM xcb_icccm_get_text_property_reply_t nameprop; if (xcb_icccm_get_wm_name_reply(dpy, cookies->get_wm_name, &nameprop, &err)) { /* can't use strcmp, since nameprop.name is not null terminated */ if ((namelen == (size_t)nameprop.name_len) && memcmp(nameprop.name, name, namelen) == 0) { w = window; } xcb_icccm_get_text_property_reply_wipe(&nameprop); } #else prop = xcb_get_property_reply(dpy, cookies->get_wm_name, &err); if (prop) { if (prop->type == XCB_ATOM_STRING) { const char *prop_name = xcb_get_property_value(prop); int prop_name_len = xcb_get_property_value_length(prop); /* can't use strcmp, since prop.name is not null terminated */ if ((namelen == (size_t)prop_name_len) && memcmp(prop_name, name, namelen) == 0) { w = window; } } free(prop); } #endif else if (err) { if (err->response_type == 0) Print_X_Error(dpy, err); return 0; } } if (w) { xcb_discard_reply(dpy, cookies->query_tree.sequence); return w; } tree = xcb_query_tree_reply(dpy, cookies->query_tree, &err); if (!tree) { if (err->response_type == 0) Print_X_Error(dpy, err); return 0; } nchildren = (unsigned int)xcb_query_tree_children_length(tree); children = xcb_query_tree_children(tree); child_cookies = calloc(nchildren, sizeof(struct wininfo_cookies)); if (child_cookies == NULL) Fatal_Error("Failed to allocate memory in recursive_Window_With_Name"); for (i = 0; i < nchildren; i++) { if (atom_net_wm_name && atom_utf8_string) child_cookies[i].get_net_wm_name = xcb_get_net_wm_name(dpy, children[i]); child_cookies[i].get_wm_name = xcb_icccm_get_wm_name(dpy, children[i]); child_cookies[i].query_tree = xcb_query_tree(dpy, children[i]); } xcb_flush(dpy); for (i = 0; i < nchildren; i++) { w = recursive_Window_With_Name(dpy, children[i], &child_cookies[i], name, namelen); if (w) break; } if (w) { /* clean up remaining replies */ for (/* keep previous i */; i < nchildren; i++) { if (child_cookies[i].get_net_wm_name.sequence) xcb_discard_reply(dpy, child_cookies[i].get_net_wm_name.sequence); xcb_discard_reply(dpy, child_cookies[i].get_wm_name.sequence); xcb_discard_reply(dpy, child_cookies[i].query_tree.sequence); } } free(child_cookies); free(tree); /* includes storage for children[] */ return (w); } xcb_window_t Window_With_Name( xcb_connection_t *dpy, xcb_window_t top, const char *name) { struct wininfo_cookies cookies; atom_net_wm_name = Get_Atom(dpy, "_NET_WM_NAME"); atom_utf8_string = Get_Atom(dpy, "UTF8_STRING"); if (atom_net_wm_name && atom_utf8_string) cookies.get_net_wm_name = xcb_get_net_wm_name(dpy, top); cookies.get_wm_name = xcb_icccm_get_wm_name(dpy, top); cookies.query_tree = xcb_query_tree(dpy, top); xcb_flush(dpy); return recursive_Window_With_Name(dpy, top, &cookies, name, strlen(name)); } /* * Standard fatal error routine - call like printf */ void Fatal_Error(const char *msg, ...) { va_list args; fflush(stdout); fflush(stderr); fprintf(stderr, "%s: error: ", program_name); va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, "\n"); exit(EXIT_FAILURE); } /* * Print X error information like the default Xlib error handler */ void Print_X_Error( xcb_connection_t *dpy, xcb_generic_error_t *err) { (void)dpy; // unused char buffer[256] = ""; if ((err == NULL) || (err->response_type != 0)) /* not an error */ return; /* Todo: find a more user friendly way to show request/extension info */ if (err->error_code >= 128) { fprintf(stderr, "X Extension Error: Error code %d\n", err->error_code); } else { switch (err->error_code) { case XCB_REQUEST: snprintf(buffer, sizeof(buffer), "Bad Request"); break; case XCB_VALUE: snprintf(buffer, sizeof(buffer), "Bad Value: 0x%x", err->resource_id); break; case XCB_WINDOW: snprintf(buffer, sizeof(buffer), "Bad Window: 0x%x", err->resource_id); break; case XCB_PIXMAP: snprintf(buffer, sizeof(buffer), "Bad Pixmap: 0x%x", err->resource_id); break; case XCB_ATOM: snprintf(buffer, sizeof(buffer), "Bad Atom: 0x%x", err->resource_id); break; case XCB_CURSOR: snprintf(buffer, sizeof(buffer), "Bad Cursor: 0x%x", err->resource_id); break; case XCB_FONT: snprintf(buffer, sizeof(buffer), "Bad Font: 0x%x", err->resource_id); break; case XCB_MATCH: snprintf(buffer, sizeof(buffer), "Bad Match"); break; case XCB_DRAWABLE: snprintf(buffer, sizeof(buffer), "Bad Drawable: 0x%x", err->resource_id); break; case XCB_ACCESS: snprintf(buffer, sizeof(buffer), "Access Denied"); break; case XCB_ALLOC: snprintf(buffer, sizeof(buffer), "Server Memory Allocation Failure"); break; case XCB_COLORMAP: snprintf(buffer, sizeof(buffer), "Bad Color: 0x%x", err->resource_id); break; case XCB_G_CONTEXT: snprintf(buffer, sizeof(buffer), "Bad GC: 0x%x", err->resource_id); break; case XCB_ID_CHOICE: snprintf(buffer, sizeof(buffer), "Bad XID: 0x%x", err->resource_id); break; case XCB_NAME: snprintf(buffer, sizeof(buffer), "Bad Name"); break; case XCB_LENGTH: snprintf(buffer, sizeof(buffer), "Bad Request Length"); break; case XCB_IMPLEMENTATION: snprintf(buffer, sizeof(buffer), "Server Implementation Failure"); break; default: snprintf(buffer, sizeof(buffer), "Unknown error"); break; } fprintf(stderr, "X Error: %d: %s\n", err->error_code, buffer); } fprintf(stderr, " Request Major code: %d\n", err->major_code); if (err->major_code >= 128) { fprintf(stderr, " Request Minor code: %d\n", err->minor_code); } fprintf(stderr, " Request serial number: %d\n", err->full_sequence); } /* * Cache for atom lookups in either direction */ struct atom_cache_entry { xcb_atom_t atom; const char *name; xcb_intern_atom_cookie_t intern_atom; struct atom_cache_entry *next; }; static struct atom_cache_entry *atom_cache; /* * Send a request to the server for an atom by name * Does not create the atom if it is not already present */ struct atom_cache_entry *Intern_Atom(xcb_connection_t *dpy, const char *name) { struct atom_cache_entry *a; for (a = atom_cache; a != NULL; a = a->next) { if (strcmp(a->name, name) == 0) return a; /* already requested or found */ } a = calloc(1, sizeof(struct atom_cache_entry)); if (a != NULL) { a->name = name; a->intern_atom = xcb_intern_atom(dpy, False, (uint16_t)strlen(name), (name)); a->next = atom_cache; atom_cache = a; } return a; } /* Get an atom by name when it is needed. */ xcb_atom_t Get_Atom(xcb_connection_t *dpy, const char *name) { struct atom_cache_entry *a = Intern_Atom(dpy, name); if (a == NULL) return XCB_ATOM_NONE; if (a->atom == XCB_ATOM_NONE) { xcb_intern_atom_reply_t *reply; reply = xcb_intern_atom_reply(dpy, a->intern_atom, NULL); if (reply) { a->atom = reply->atom; free(reply); } else { a->atom = (xcb_atom_t)-1; } } if (a->atom == (xcb_atom_t)-1) /* internal error */ return XCB_ATOM_NONE; return a->atom; } /* Get the name for an atom when it is needed. */ const char *Get_Atom_Name(xcb_connection_t *dpy, xcb_atom_t atom) { struct atom_cache_entry *a; for (a = atom_cache; a != NULL; a = a->next) { if (a->atom == atom) return a->name; /* already requested or found */ } a = calloc(1, sizeof(struct atom_cache_entry)); if (a != NULL) { xcb_get_atom_name_cookie_t cookie = xcb_get_atom_name(dpy, atom); xcb_get_atom_name_reply_t *reply = xcb_get_atom_name_reply(dpy, cookie, NULL); a->atom = atom; if (reply) { int len = xcb_get_atom_name_name_length(reply); char *name = malloc((size_t)len + 1); if (name) { memcpy(name, xcb_get_atom_name_name(reply), (size_t)len); name[len] = '\0'; a->name = name; } free(reply); } a->next = atom_cache; atom_cache = a; return a->name; } return NULL; } qt5platform-plugins-5.7.12/xcb/3rdparty/dsimple.h000066400000000000000000000046001476226662200217120ustar00rootroot00000000000000/* Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP 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. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * dsimple.h: This file contains the definitions needed to use the * functions in dsimple.c. It also declares the global * variable program_name which is needed to use dsimple.c. * * Written by Mark Lillibridge for Xlib. Last updated 7/1/87 * Ported to XCB over two decades later. */ #include #include #include typedef enum { False = 0, True } Bool; /* Global variables used by routines in dsimple.c */ extern const char *program_name; /* Name of this program */ /* Declarations for functions in dsimple.c */ const char *Get_Display_Name(const char *displayname); void Setup_Display_And_Screen(const char *displayname, xcb_connection_t **dpy, xcb_screen_t **screen); xcb_window_t Select_Window(xcb_connection_t *, const xcb_screen_t *, int); xcb_window_t Window_With_Name(xcb_connection_t *, xcb_window_t, const char *); void Fatal_Error(const char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1, 2) _X_COLD; void Print_X_Error(xcb_connection_t *, xcb_generic_error_t *); struct atom_cache_entry *Intern_Atom(xcb_connection_t *, const char *); xcb_atom_t Get_Atom(xcb_connection_t *, const char *); const char *Get_Atom_Name(xcb_connection_t *, xcb_atom_t); qt5platform-plugins-5.7.12/xcb/CMakeLists.txt000066400000000000000000000037151476226662200211020ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later project(dxcb) find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets) if(${QT_VERSION_MAJOR} STREQUAL "5") find_package(Qt5 REQUIRED COMPONENTS XcbQpa X11Extras EdidSupport XkbCommonSupport) else() find_package(Qt6 REQUIRED COMPONENTS OpenGL XcbQpaPrivate) endif() # NOTE(sbw): 禁止语法树上的 vrp 优化,-O2/-O3 默认开启,会导致测试虚析构函数 HOOK 失败 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vrp" CACHE STRING "disable vrp optimization" FORCE) add_definitions(-DDXCB_VERSION=\"${DTK_VERSION}\") if(CMAKE_BUILD_TYPE STREQUAL "Release") add_definitions(-DQT_NO_DEBUG_OUTPUT=TRUE) endif() include(${CMAKE_CURRENT_LIST_DIR}/xcb.cmake) include(${CMAKE_SOURCE_DIR}/src/src.cmake) add_library(${PROJECT_NAME} SHARED ${GLOBAL_HEADERS} ${GLOBAL_SOURCES} ${xcb_SRC} ${DBUS_INTERFACE_XMLS}) include(${CMAKE_CURRENT_LIST_DIR}/linux.cmake) set(EnableCov CACHE BOOL FALSE) if (EnableCov) find_package(DtkBuildHelper REQUIRED) dtk_setup_code_coverage(${PROJECT_NAME}) endif() target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::CorePrivate Qt${QT_VERSION_MAJOR}::DBus Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::Widgets ) if(${QT_VERSION_MAJOR} STREQUAL "5") target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::XcbQpa Qt5::EdidSupport Qt5::EdidSupportPrivate Qt5::XkbCommonSupport Qt5::XkbCommonSupportPrivate Qt5::X11Extras ) else() target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::OpenGL Qt6::OpenGLPrivate Qt6::XcbQpaPrivate) endif() if(NOT INSTALL_PATH) set(INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/plugins/platforms) endif() install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_PATH}) qt5platform-plugins-5.7.12/xcb/README.md000066400000000000000000000000521476226662200176100ustar00rootroot00000000000000# qt5dxcb-plugin The Qt5 platforms plugin qt5platform-plugins-5.7.12/xcb/cursors/000077500000000000000000000000001476226662200200345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/cursors/README000066400000000000000000000002131476226662200207100ustar00rootroot00000000000000All images under this directory are made by Wuhan Deepin Technology Co., Ltd. Licensed under GNU GENERAL PUBLIC LICENSE Version 3 or later.qt5platform-plugins-5.7.12/xcb/cursors/all-scroll.png000066400000000000000000000047701476226662200226160ustar00rootroot00000000000000PNG  IHDR00W IDATx͚h?νq1V̭k6@]Юѡ,4:)t&:e &p+i)!6Tt-Kf)hVk:#B?6&Zrss<9ωp  Ξ=[ f͚ ֧>X4x<7++3o,?L ! !R.t( Bhdd@5ѕk%XyGGZ4M)ܿܿFFFla߾}սvZOPs2 c:uW^y) @Agg'< iNy: IJ* o[MNNpD:.P رcz#vM* bL@Ç9D~$m3gv[WXAyfwʕ+st巅oʕ=z766v3@C0bػ?sLf~v9[>/JE΁9m۶ӧOSQQam%XLar(;\YYR!,c x_$gi1%`dSAHQ<֦ը|?-yWAh5_AH~<BO? aLRp^$~@=g?phYi,&o g9Lxڵkg#o{,Agp'l4.RA/ա5}JCT{n6Cr6 QƋGIENDB`qt5platform-plugins-5.7.12/xcb/cursors/bottom_side.png000066400000000000000000000034551476226662200230610ustar00rootroot00000000000000PNG  IHDR00WIDATx_hT?ޙtd[jdDҕc}Pc[(+O EԇJEć6  >ԇVDCԭbL$3ׇ2I͝;|;Ek2& 4[%ҖϽ"S門hSi oݻ=Z T+cUiy bVmqi `JWm+++–esܔ|s #xp0իoANXQ`6*wRzttTN l4]6 ?|pBk׮a1<<,\0xǎ ސcۚjO;ywe?~L2<l… y^6de '|@W>uݞl6˞={H%#DQ`IoD=Y\q^x=dT*3 q-u;3 \nݺq<#y g8q]]]}'ӫ5w@ۡCvOW299&OLLpevGgjQ r~RA;33Wٶ8*) }:hsii?fYvE&IyEH7oAsAXrTQo _!JrNٷoP/_U3RJ :jMMM,ZE<=UZ-pMк rJN;wP,3*F%tU\i!]+?S\y)|%`b0WZ74UTyofm7nEЕ{%@*%r>ʩBܩ$вv"J.,|TPRn&ʂՅS_M˛7o.yӧV]Ƶf-]PUٌ]y AlJ(]=n"VQM^*̀LVDllKt @e$ۇͽM=1Wj`QU^+˲W瀔ZX?_w50Ҫt0K(ZR+zYjE^:pyu̙yZ]tZ2'! _=DY[N7]gvv뮮? 133Ӑz{{{.sss7E7`M9Baaa.(b1B_@9]mKY6O=F"nܸmU;-bbbX,yP( Ou|WOxDc!غu+Oy?|)ݻwrZ\   ?sGp"2 ZzQΕO^`p``WB]Ƅm¶mqY9^" 1 91"|=Cࣱ/dR$Ux)ȑ Z3JAmv9io7T*m4X\\3ͫהn7I`)|>  SD(. @#[JSr###)mb)]N 33}s|=VSr̦^}3M\#-RwTMn~`IENDB`qt5platform-plugins-5.7.12/xcb/cursors/crossed_circle.png000066400000000000000000000036171476226662200235340ustar00rootroot00000000000000PNG  IHDR00WVIDATxY]hW6l͊imMTtUbF(Ah#X)hM/>IcTPOeנM6&3aޙBvf9w9wνE4+-qNL,FD!_=$K@8e ]%" ~!Ewm4 hQ %E, X(0@ӧPhDDIIg^ﮦr|mqGNH |p{OO`0+IdRc`0xv sIɓu`Ydbb3gj96 =x+7<ɓ'dY~A"D7nۻڵĊUU۰!,O<|p;1L|>B΁DTDt(ŋ#hU1pr_$M!?qOlJZ_O481~H)߿!f^Q]38 %rf$Ȍ`hiiqIZuq*15}ZDn---.DrƱdD(HbxEv"Wun(Ly|ΝJ I"bWtZM>\vQ&tDȴZ%CC< %&úH>P&0Q8K5扈z{3k@9y$"/h&Q rPT}f҇OPE7MI LIu4 0 hdjjjh\ :_SSS# h^>֩_~cP`QZ6n|?u?~ oLW`%[li`I|: V^;czmSX+*HjllѢ.CO@(P jX O񊹶6Ȉ@5"CY(BN^bV'&xf .N8@%@lE HՁbņ$ZbDOn~@b?bb(0={|#I[;IJӫNE!{W5/Iқ;v| `90&i}YLrAM &ImtM-h0,P`eWW/^/1+Lcg+EÌKJQPLc\#cDĖ.MnpADD}}}%HrQ/l)mmmp-饻؁֯'VQA gMMD==17>Ij[E$r"2)$\۶mvhh3M:nݺ| )nl$bՈiÇ|mBdY?znZ&㱉Y#29Xihh(޽{ñ`~VV$䋱? bottom_side.png all-scroll.png crossed_circle.png dnd-copy.png dnd-link.png dnd-move.png grabbing.png hand1.png up_handle.svg down_handle.svg left_ptr_watch_0001.png question_arrow.png sb_h_double_arrow.png sb_v_double_arrow.png qt5platform-plugins-5.7.12/xcb/cursors/dnd-copy.png000066400000000000000000000052501476226662200222610ustar00rootroot00000000000000PNG  IHDR00W oIDATx{lS?~8&)xt(PvTU[N-+mĖB: )c*tR[$n@i ai< %'`4v|{=IO>s~s~scap~edhI ~EAn,mLm :R8+`8tv9~y$g$$U\\~iZⶦi_+r>- ܦ/yݧ(5a"Mb>?zȑ=<g3*»\ ?AӴBMWUBtuu5kֈjq9!XL⋢R̛7O|gB!ҥKo477/7"Oߜ%$UwYb~9SUUE(J X?O?Mghhhn7;MBgϞ̙31 N} HfȤ'N555,Zʕ+0&q8ӧQU5ɱX+W7|C(J4;vFc7n~tCLqBh4ڝCaa!|ׯ/dSH5v`a[ȤB`0PQQi}XQEI5܅')J+={6e޻ad$1iҤL>!BU2e~@A2{GG}>KWa '`}[cc|)s=Gss3999\.h G0r3߬`d5k@$!R`pXA RU(E}ND>4ܤ[wL'0~h&7J=k2V/)bd,FIG`,~R2HTUl>k׮0VP($ $'lfhDY0`ٲeCXA|A֯_ϡCr pٺΝϟ_}IQz'1Ɉ;D4bŊ*--漼$?ә { (!C*K?([ncǎ{<xDIIػw4mH| ]&I9$jb`Pv%z(Ennv -ƍ'S$q{bC˓3ON"o.ŶK]E\SRƄBe@!uf*sturw&LիL:՘Af%!Ncǎ1{dC>\[X`wS(M˗CBTyD;f̘9tA9!۶m^K<|۠l~6a#ܺud ^H^<:D"Huuŗ,YΝ;X,zJn}=|<'߯|z/:thJ͙Hsu !˖-/`!IUUbIxƯS1}O|.X-9dYzuֽzf̘ŋQh4J8ܼyOUUm] /k c>V[[[f0)ټy_pa,dyq:Ʌ>@ zunF… $s! FH$>[ZLw S𒚺?Ɫx;dNt:˫@) b9Phϗwr\d8)$3;ovʍlf?ٔp]d,Aϋ2@62;'#a#rQ)j;E"YK624[?w7 oFv}<=RK@NI|K*r&ۊB́>pdL*/#bގd09wB J#Hr@, B8:&9QHɋZ[[OJ '"mB;*>R4>ה ?.)|2|2 $^oٲjgg G I۰[MֆH"w PvgSH3<] lZ >?<---5eeeOC"~m-n3&nJ---B@dB$*%7[RRܹzr#ԵNsMᕉ[R SNeGGm]07M1wq."#4uT;3%w&s p6#P0M__*kqXD"ZZZuttt`Z3̙Sm۶q݅X3gnسgϟ'y饗~zzPU-ZDEE˗/aÆWtFͤ:ÑP__(DhmmMS7oTUe߾}BX۷#փd~,BP(t=%%TUMh|̙uW^8ݎIh٩D9z`a]H&BvPTT4@,:::%+pp8PFsڹ +$w :`Qy(HƽNF2O{[[ 'O9YB m-Q2t& wvv6?? M6n0b2qmgϞ]$Gp)))Ɗ9|> f9x`֭[9w``08Kq?~ʉA%o~3YYYQ߉I.r cn@fxd eX,cɬP(fG'a(3(6-;??+W9V/$'G62n3<'xA32)5kFi+2[rqZ[[%;;MMM+++EKd&w$7 -K~2*((YYY.l2Q__,QKJ}}}gjkkēD@0pooWB/qƍ\.rD^^8tPUuH~(F S $/z4e˖;vXFH|ff&,X -S 0. 2B(-nn޼y}gnQ@M>W{{'N̘1A t2o޼X \NO1s̟~~ PqD:v?ݻw3 Qo}:,Z[ - VH<):TU\cX<ϧ,63s5Rnv?q7+O$+++BD׬Yg}Ɣ)SB H'EE[S_ѳï05 bŋh`Kvt(uAR^˧o۶UÑ%t8h4JAAQ~'8횒W»{޽>l3/Eh]Kp׮]YYY777D"tK(N36FJCrؾ S:O|.]#L; |"a܉4+tڤzE'NP:-i2 s5P7n4''gtG>"vz0 L'^qƵ2ڵcLǜϑ8Z?9axʺuYzCSNriii@w]tÇ~}.\}L/ۧylU2[EQ,34Y5/1c+Pͦv3&7 x\4 <ۣ迢h*///4mDDjx<~ԩSu5n>,俳<@!P *6nܸ,M4MKnjG},0S x R d(4M+"(DDn߾-{_|Q.]$""DBm&ׯ7J__(2W_u?)c"JəL'Y]'2/..j?YQ{1~ѣG9}t<ٳgq&NӴŋW^}H 1c ߻ϝ;⭚ϳn:ZZZ?f||M4 UUypBrL4׮]# yyyE'O>$gϞpڵkP$V4if/PU5D1UU 1Mxwbk:@aal92vrb;24MK9̙3icCCCrN9wttTżb@x5L \j V\###ic4SE>,iLx<]UUsldc^d{tݺusҥXj"Ȭʖ$)dwWUU `TUUrrO7~iΟ?D tR.\&{ H.^k֬9o>>3(ht,X O~~>^nRJKK+3JFZh8'2̸ pyf!p8fFSYqKU1YZUU\`(G"Ywd@?=\N+mxx<)c"b kx饗ziLUQE77H~7 =R`5@{wGU2&ȶ6:::ضmhN5M˳1 (+_{QꤨhZXX((q(f eٲe5Li 06_[/ny& 2' Ohhh'x+W0|n71`1-4u5WK ""x$???guHKK H0(PT$3Pqm&DD=*G\.WN!""HDڤIM"\~ca`zm1a<&ch>| f… R[[+NSGVmjjP($"">OR-_2XrحPh~+{NH$$I4`0(oߖQ jZs^UU8wܟQ `f2F7osAAK.uOLL' -I$Iodll,ScNlVWWwX޽+ 5- #WU%Uzx y{{+~퐈H44555RSS6ꫯ&cbbbbnlRNmLmED% "?Z' #(e˖-R]]:xkk\zUDD4M^~}lfZic&fgC쪭} ĉtuuͺ z߿g}P(#G. 6ECjv\d-"g6jJ@DPކϩ`@>z@C9A__E˦M2U*++oذA\""zVxx5r f; k5 Xڽ{w p8,;wLZQQ!i;wp8,Ƶ^}D.Eyɒ%~嗧RVV&eee~7no >d &LE f{5@ɓ'lUJJJ$ (޿3\11z`q;%YH,GOktvv`رcGZc|jEڸitd%aګ Ǐ?$MMMzI'O| }a4/Gwp! kvH˗TJKK""oxsM3*%fCLY-|G޽; "r19v예+Vh~o'H!/BQ%h{5ӻ ^Iz>mHdZ/k|GFFȃ>C3t@/S!EfP 'wp?3p9?d.$[Ns᳾jRmN),aQA:,e|d>BIENDB`qt5platform-plugins-5.7.12/xcb/cursors/down_handle.svg000066400000000000000000000014731476226662200230440ustar00rootroot00000000000000 slider 2备份 4 qt5platform-plugins-5.7.12/xcb/cursors/grabbing.png000066400000000000000000000040751476226662200223230ustar00rootroot00000000000000PNG  IHDR00WIDATxZol]ǗCQr-j֧P"rҥYB!_@Hp-J $ Em(H "@|r@*DI#4 Ŗ]M?xy^:NBHGٞݷo~3γ#h>3#*YDL1"s֊z^aA [Sߓ !B [2 fb)@qVm**K/8::mgg87(cDD`nݺE3ʲLΝzxI xKUlذawډ(ś1'"z)m޼jkk۷DDt̙\ׯQ8o tU2#DLE-|p8|YQq\YlY#Q*\M5p>|u]]gb׮]r *++!l&ַ=z V׋v?:p8F{Ul0tسgϷeC[[[f@0 @V엖n&J-""Q5!> e@8NIU2;bn滮!%HXYEQ@*;@H&B2k.xɗFg"R`6nܸ(|?zzz MMM E@!\ڽ{D"1^YY[.E){T,?~|>ѽ 5 xh/S*vqMFSSӢx@C}) {^˖-5o7z@@ ߜx\VVK.b~hBHQYz(Jȑ#T*ݴi:w8l`%~Y2+B+VxcSDD QmFDDHT ݃-t%CǷ?A)5~/N"'O$IdZ?(Z? ӭF Nq:uvv~yA;Nx<444Y@jH'=Z1ӽ"%j(UFoLZH$2sίqEQ(9@VWWok0O2 WT* B޽r~>R >-fZ)Vit[k>nyR"w@@BzMd3Qg?:ƐN @{w99ev^qɢ||<(#ki1y`6')>mQtٕMR![tc dR ن,h"}Ԣc!\̎\t{s }W#b6 91;7Fb(\U7=>@{FIENDB`qt5platform-plugins-5.7.12/xcb/cursors/hand1.png000066400000000000000000000053431476226662200215420ustar00rootroot00000000000000PNG  IHDR00W IDATxŚlTU?󳝁"[X]()!e,Iݤj7ՀXqY~H6qaٸDXqe-b6ֶ3MڲimrJί73ox:S*R&'o=s}& 8jŨm"BsTtGi *UJ+5b)%Owvvn9u@9&:u*28FDK'!&ԴJʩJ؁)T fo BC"_gΜzkE4, {hn d(u֌_'E ,̮,PҥKRTWW!@+ yU{{{EOOQ$~>%%% HyK ہԪ^(>y%I~7  !DUU((("??__^tttDojj6l^|aϜ9HB07憆7~eKqݘ{~o8v,( v9x`t:$_j0]-M y^0E6 /000IMM5 F1\oχcKRR TBD2xl,&)^vimm%777QEQ^okv;ӧO~n26m]v5a޽ܠq0]t ??fԄdxx2/--w6?<oUXr%P(r zghhh+a0doΒ%KVXq% &⁨َ=z;LBNNN---7n ֊lbDWݻX,?%L#5H.驇0F>Ux%'btttLzz:@?xR/^z8P+V088Dd]HM[*kTEZx1)))1\.~-P!˗/ŋDĀ BB---#nd2`0 0B~?.$IrSǏoV0$ x(((c .>EQR?oѢEv|>ߕw}׭0^ݯ8w*Ty@FCCC>>}}}N4I8ꃊТ_$i8339sX%nT- x< DomPZ1Q\}pΟ?WWW޺p$&/^(,,H$書JvZ{챸V5nM ϮӦM&##chrL˗/Wڵj֭kJJJ~wY***bpvm…rZ۲&l~r?:r}}}̚5YYY[{_h)+<@kkk+W```IQ is[[&Q.I/Q.]ʓO>IqqqRNNN1@jj*999477v5ܠOM Dk{w'޽{9q,Gt:k֬I6o<;wNHRjjJ kjjxᇩLxwߍ,>ZGvxxꩧZڵk|r'x+$X_P?~zZZW glْppIxg9y$SNsڵk]u}^y-[Ų,cz{{'B3g`dd_O4+Zm?4֭tX,;v3f$RvIZZ`УW^蔗Q`tofϞÇ'-P Ö(ɲ-..xRe(IMMPR@DCݖΝ;(T&ɠ5 BqAȲ?t!!Dh۶mdee11i4n,_x1Ȳ `0GF^PAD7%I.**bݺuw@ l11RIB8VPzڎDܼys󩨨t P(t144;y^x222Vj<'xs)))9rdR=(KJJO6T*n۶OyIf(24YS>^j |gϞ=paIPPP@oo;nڴ.t  R7o0MʄBH)**w޹L&?!f;S o},fggv !իWEiiHNN%33Sٳ'w|…WsIBx65b@6P~b,l6V z*2#ɵlկ KDvo7xi`ydD J>8XDnǼOՍcQe}GF/&Ԛ\2X=]/]h|}2(.򌽛N(mIENDB`qt5platform-plugins-5.7.12/xcb/cursors/left_ptr_watch_0001.png000066400000000000000000000045031476226662200242110ustar00rootroot00000000000000PNG  IHDR00W IDATx͚mlSױ_``LCҌl-C mxѪih6v$V-VU;DetR&hJBSJ`t6lf'og|bkyG׾>>\+7uUr)pS~xJ&UsZ k5HBʕ+?Tk@_'#Fd9@,U6sWɈԉ}f-DprS8sf`֨>2cnʻl`&b.L`,U/Yā,K裏6JrQm1u@phmmnm``q v+@@=p;@8i[l!sNZ4줧EQ|mmmcj ȼn*D)܂n4y9pmmm8v "rZ \0رc> ԰\)H۷˖,_wYA6pCHJʿa H[~+W~СYO6@[b!DAnߺu+o&eWZ!BMnR"0< Mxg8x ׮]յn.U1DIJiv!21MB"?ҥKb444*i.]zݸq 4@L- o*2m᳀fEuNE]]C={Vk n#҇[иpDy7HR"H$"/^,kTW_}u]I3( b.ڙ3RǺ3w\xO4uL$8q'OryFGGF477˩q1M/-[Wv).U/ 5McÆ |>4`޽$ɒ5ٰaׯ +V8N(0 ([l%dΜ9@%x՛6m:SlRXWW>(/_HX,޽{={6Th4:JM NS3<^Nyꩧxbѕy:駟&N Z?{lg΅r{#SNaY smii5QlEl*^X x+ 9_/o\/jZ M(߳T/1x b0X=emB )I,ӊ,D&U(1H+6ݟ-MM9~S-`ŝϚRⓓ` sA4T$UPCԠ_Cx<^G!8ih,jR[[m-~_VLB/xC \?\_:2_-/iRn9r=ܳ `o'x7|iXv{^P ^>oիW BMS5K9$:&DRU(n*L]G&o%3QfD dsRDU~o4f'v޽'H\[䛚ۀ;E?;}*cccx~oy]F/H*>'r דyt]ۻڵk/۷o; Xbuw]<~,)ՔT]J =֭[6o޼EP> KRWΝ;7t^z0i{ǍABH* :+: Aw v `p1 ap+%iMwy_@1)V*t\6][xY4MlIENDB`qt5platform-plugins-5.7.12/xcb/cursors/question_arrow.png000066400000000000000000000043121476226662200236230ustar00rootroot00000000000000PNG  IHDR00WIDATxՙkhT+:3Č> (5H)4T[PZV ^"_CVQ Ԉ^5DČ3~9ə3L`q{Xkm)b">h>e{2c&37h|%m"FJA @Օ iHz`r,T=0W :&0 XzRfZV$I!D$088}wwUV]okk N5"zۀ GrMmoou(j)J$SRR L&T? ,:Qcǎ}aÆ9?۷o>ͼ|nYt)>p8޽{.\xaF[C?D xիWZxYŒ 9y$/_FQ#RTTDuu5>!D7>ƈDR%*9 طm6VufSS;w?)pXVXnں#֑0R)Ѓ؁ߟu\I8p!<ϒG}?$"`c@`Ǐաrsof׮]dee5rii*ֶ0pL~[-[J$IS08q `PU5r(//暶vSLElD'455N5kְi&{v͛7Oٽ{iۖ8|mY`\Sh3iҤ/=z7YYYl߾UѣGbŊ?+*..fڴiqE$[EEEn bfn><B}3fjMM>|ԩ<ed蕦BBhɌ ݼyWB)^>}zVUU OӧO?':ub}b'dv ], ϙ3g9@mm-CCCqy< KٸqMZ8(͒6De@vׯ_7=֯_! >Xr? CJ YM ,[ +W# |Zif׈ȲlWUsСC@kj>@\ $f͊k 2!>X\MmÇ+K,w2X'0^hūϞ=3m1Oꦴh2ٳgVS1<qC'f;ARh")T@Ւ&! 4Lw_&ye,4N+ko6:::(B[GP2D3VȲ3 _/c'6FkѓjʈA?"#w :w-6֒_cN!}E蜑V_!J@sƝy-b=? >4Mt5a7_IoIENDB`qt5platform-plugins-5.7.12/xcb/cursors/sb_h_double_arrow.png000066400000000000000000000037171476226662200242310ustar00rootroot00000000000000PNG  IHDR00WIDATx[hT;%$17DOxLOĞR-}lDPb$oyhDJ BT Z%PKИX0bl@qfrìgΞɭp^򇏙Y a kX÷ /Vw9Y(\㻎\qp}2BnC2raI,eK!|/0L9 Tjt+ƛ7o~_WW ݻ>})i@;~EB*(ʕ+:u ɑ3`yDŽ-Lz@z8}?f۶P\MM(**҇g$VE>v+"QYY)YO<3!{P ӒrTsN˲L!H$"[$&Ig[]/D"ӗ/_JGJ>}::8VRA bw@5 >Mէ*XB i&gϞ#My2AҝPʔJr'''P]]VL)RY:W !^(wWoE.$`ђ fTMMMz_H(EȔ)]p7E)]pwHI/6M'njm;2m? | |LWY ^' |$ֶE>_GfB ɔbPmP{O4GRvsyA:j_J;zDQLQ~S 8cK.-6<bPۢonJ`adRۭI7v=sis7^BŮJs. PbPY>Ԫ=z44MnܸAgg ߒ6EuN_~ 'N`vA+m'OA-PЕJ|8r kZH$8|0ɯȮH%F7&Xʴ$qRo#U(CVǎL8|,'[f䝍|t,ZHg}/U0d3oX&:/+dYnht!ORqhϼ{+.]ْˉB=R"壜XD~'0}ڵ`r]LYBQZfbMźb#ey֭9gggեh-]P]yu^+2ɝ@Yz@YkTJ[EYZ7{Rg+՘zzΡRRjxQC6 R1 ?o+30dsaͺ-x^U-! kIudey]N*mp:s*5Zabbb8RN߻wt[NW\f@LJvqx<^۹>SSSg;::n[.XUNx⯑H޽cϗ|CCa^|9DHt-嚫Akk'{.i'6 q0Db2|MShՖloڴWdrNDիR____|YDDVVVm 2[R$: [Ϝ9sqȩS./gܹs_ݮ\ zk`j-eΝ;3Ν;w|:ݽ zn,..JKKBnnnoߊ||*Z bys`'onn""=˲$ J0˲""277lseTc-Wj!|ϓ[a1MSLӔK.H2\زeo;xISӧO:J4ٳgS+C,_<| t{Ɔ{1שׂB66W=333J=3jɬDJȼ}!ҖTJ$$ۉPV/[Ζo slider 2备份 3 qt5platform-plugins-5.7.12/xcb/dforeignplatformwindow.h000066400000000000000000000027671476226662200233130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DFOREIGNPLATFORMWINDOW_H #define DFOREIGNPLATFORMWINDOW_H #include "global.h" #include #ifdef Q_OS_LINUX #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #include #endif #define private public #include "qxcbwindow.h" typedef QXcbWindow QNativeWindow; #undef private #elif defined(Q_OS_WIN) #include "qwindowswindow.h" typedef QWindowsWindow QNativeWindow; #endif DPP_BEGIN_NAMESPACE class DForeignPlatformWindow : public QNativeWindow { public: explicit DForeignPlatformWindow(QWindow *window, WId winId); ~DForeignPlatformWindow(); QRect geometry() const Q_DECL_OVERRIDE; QMargins frameMargins() const override; #ifdef Q_OS_LINUX void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) override; QNativeWindow *toWindow() override; #endif private: void create() override; void destroy() override; #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) bool isForeignWindow() const override { return true; } #else QPlatformScreen *screenForGeometry(const QRect &newGeometry) const; #endif void updateTitle(); void updateWmClass(); void updateWmDesktop(); void updateWindowState(); void updateWindowTypes(); void updateProcessId(); void init(); }; DPP_END_NAMESPACE #endif // DFOREIGNPLATFORMWINDOW_H qt5platform-plugins-5.7.12/xcb/dforeignplatformwindow_x11.cpp000066400000000000000000000371441476226662200243340ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dforeignplatformwindow.h" #include "dplatformintegration.h" #include "global.h" #include "utility.h" #include "dxcbwmsupport.h" #include "qxcbconnection.h" #include "qxcbscreen.h" #include #include #include #include #include DPP_BEGIN_NAMESPACE #define xcbReplyHolder(xcb_reply_type, var) QScopedPointer var enum { baseEventMask = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_FOCUS_CHANGE, defaultEventMask = baseEventMask | XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_BUTTON_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_POINTER_MOTION, transparentForInputEventMask = baseEventMask | XCB_EVENT_MASK_VISIBILITY_CHANGE | XCB_EVENT_MASK_RESIZE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_COLOR_MAP_CHANGE | XCB_EVENT_MASK_OWNER_GRAB_BUTTON }; DForeignPlatformWindow::DForeignPlatformWindow(QWindow *window, WId winId) : QXcbWindow(window) { QGuiApplicationPrivate::window_list.removeOne(window); m_window = winId; #if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) // init window id QNativeWindow::create(); #endif m_dirtyFrameMargins = true; init(); create(); // 因为此窗口不包含在 QGuiApplication::allWindows() 中,屏幕对象销毁时不会重置它的屏幕为主屏 QObject::connect(qApp, &QGuiApplication::screenRemoved, window, [window] (QScreen *screen) { if (screen == window->screen()) { window->setScreen(qApp->primaryScreen()); } }); } DForeignPlatformWindow::~DForeignPlatformWindow() { qt_window_private(window())->windowFlags = Qt::ForeignWindow; // removeWindowEventListener destroy(); // do not destroy m_window m_window = 0; } QRect DForeignPlatformWindow::geometry() const { xcb_connection_t *conn = DPlatformIntegration::xcbConnection()->xcb_connection(); xcbReplyHolder(xcb_get_geometry_reply_t, geomReply)(xcb_get_geometry_reply(conn, xcb_get_geometry(conn, m_window), nullptr)); if (!geomReply) return QRect(); auto xtc_cookie = xcb_translate_coordinates(conn, m_window, DPlatformIntegration::xcbConnection()->rootWindow(), 0, 0); xcbReplyHolder(xcb_translate_coordinates_reply_t, translateReply)(xcb_translate_coordinates_reply(conn, xtc_cookie, nullptr)); if (!translateReply) { return QRect(); } const QRect result(QPoint(translateReply->dst_x, translateReply->dst_y), QSize(geomReply->width, geomReply->height)); // auto remove _GTK_FRAME_EXTENTS xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, m_window, Utility::internAtom("_GTK_FRAME_EXTENTS"), XCB_ATOM_CARDINAL, 0, 4); xcbReplyHolder(xcb_get_property_reply_t, reply)(xcb_get_property_reply(xcb_connection(), cookie, nullptr)); if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 4) { quint32 *data = (quint32 *)xcb_get_property_value(reply.data()); // _NET_FRAME_EXTENTS format is left, right, top, bottom return result.marginsRemoved(QMargins(data[0], data[2], data[1], data[3])); } return result; } // QXcbWindow::frameMargins会额外根据窗口的geometry来计算frame margins,在这里我们不希望使用这个fallback的逻辑 QMargins DForeignPlatformWindow::frameMargins() const { if (m_dirtyFrameMargins) { if (DXcbWMSupport::instance()->isSupportedByWM(atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_FRAME_EXTENTS)))) { xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, m_window, atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_FRAME_EXTENTS)), XCB_ATOM_CARDINAL, 0, 4); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, nullptr); if (reply) { if (reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 4) { quint32 *data = (quint32 *)xcb_get_property_value(reply); // _NET_FRAME_EXTENTS format is left, right, top, bottom m_frameMargins = QMargins(data[0], data[2], data[1], data[3]); } free(reply); } } m_dirtyFrameMargins = false; } return m_frameMargins; } #ifdef Q_OS_LINUX void DForeignPlatformWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) { bool fromSendEvent = (event->response_type & 0x80); QPoint pos(event->x, event->y); if (!QPlatformWindow::parent() && !fromSendEvent) { // Do not trust the position, query it instead. xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), xcbScreen()->root(), 0, 0); xcb_translate_coordinates_reply_t *reply = xcb_translate_coordinates_reply(xcb_connection(), cookie, NULL); if (reply) { pos.setX(reply->dst_x); pos.setY(reply->dst_y); free(reply); } } QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); QPlatformScreen *newScreen = QPlatformWindow::parent() ? QPlatformWindow::parent()->screen() : screenForGeometry(actualGeometry); if (!newScreen) return; // auto remove _GTK_FRAME_EXTENTS xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, m_window, Utility::internAtom("_GTK_FRAME_EXTENTS"), XCB_ATOM_CARDINAL, 0, 4); QScopedPointer reply( xcb_get_property_reply(xcb_connection(), cookie, NULL)); if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 4) { quint32 *data = (quint32 *)xcb_get_property_value(reply.data()); // _NET_FRAME_EXTENTS format is left, right, top, bottom actualGeometry = actualGeometry.marginsRemoved(QMargins(data[0], data[2], data[1], data[3])); } // Persist the actual geometry so that QWindow::geometry() can // be queried in the resize event. QPlatformWindow::setGeometry(actualGeometry); // FIXME: In the case of the requestedGeometry not matching the actualGeometry due // to e.g. the window manager applying restrictions to the geometry, the application // will never see a move/resize event if the actualGeometry is the same as the current // geometry, and may think the requested geometry was fulfilled. QWindowSystemInterface::handleGeometryChange(window(), actualGeometry); // QPlatformScreen::screen() is updated asynchronously, so we can't compare it // with the newScreen. Just send the WindowScreenChanged event and QGuiApplication // will make the comparison later. QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) if (m_usingSyncProtocol && m_syncState == SyncReceived) #else if (connection()->hasXSync() && m_syncState == SyncReceived) #endif m_syncState = SyncAndConfigureReceived; m_dirtyFrameMargins = true; } void DForeignPlatformWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) { connection()->setTime(event->time); const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; if (event->atom == atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_STATE)) || event->atom == atom(QXcbAtom::D_QXCBATOM_WRAPPER(WM_STATE))) { if (propertyDeleted) return; return updateWindowState(); } else if (event->atom == atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_FRAME_EXTENTS))) { m_dirtyFrameMargins = true; } else if (event->atom == atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_WINDOW_TYPE))) { return updateWindowTypes(); } else if (event->atom == Utility::internAtom("_NET_WM_DESKTOP")) { return updateWmDesktop(); } else if (event->atom == QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_NAME)) { return updateTitle(); } else if (event->atom == QXcbAtom::D_QXCBATOM_WRAPPER(WM_CLASS)) { return updateWmClass(); } } QNativeWindow *DForeignPlatformWindow::toWindow() { // 重写返回空,目的是防止QXcbConnection::platformWindowFromId接口能返回一个正常的QXcbWindow对象 // 这样会导致QXcbDrag中将本窗口认为是自己窗口的窗口,从而导致drag/drop事件没有通过x11发送给对应窗口 // 而是直接走了内部事件处理流程 return nullptr; } #endif void DForeignPlatformWindow::create() { const quint32 mask = XCB_CW_EVENT_MASK; const quint32 values[] = { // XCB_CW_EVENT_MASK baseEventMask }; connection()->addWindowEventListener(m_window, this); xcb_change_window_attributes(xcb_connection(), m_window, mask, values); } void DForeignPlatformWindow::destroy() { connection()->removeWindowEventListener(m_window); } #if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) QPlatformScreen *DForeignPlatformWindow::screenForGeometry(const QRect &newGeometry) const { QPlatformScreen *currentScreen = screen(); QPlatformScreen *fallback = currentScreen; // QRect::center can return a value outside the rectangle if it's empty. // Apply mapToGlobal() in case it is a foreign/embedded window. QPoint center = newGeometry.isEmpty() ? newGeometry.topLeft() : QPoint(qRound((newGeometry.left() + newGeometry.right()) / 2.0), qRound((newGeometry.top() + newGeometry.bottom()) / 2.0)); if (!parent() && currentScreen && !currentScreen->geometry().contains(center)) { const auto screens = currentScreen->virtualSiblings(); for (QPlatformScreen *screen : screens) { const QRect screenGeometry = screen->geometry(); if (screenGeometry.contains(center)) return screen; if (screenGeometry.intersects(newGeometry)) fallback = screen; } } return fallback; } #endif void DForeignPlatformWindow::updateTitle() { xcb_get_property_reply_t *wm_name = xcb_get_property_reply(xcb_connection(), xcb_get_property_unchecked(xcb_connection(), false, m_window, atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_NAME)), atom(QXcbAtom::D_QXCBATOM_WRAPPER(UTF8_STRING)), 0, 1024), NULL); if (wm_name && wm_name->format == 8 && wm_name->type == atom(QXcbAtom::D_QXCBATOM_WRAPPER(UTF8_STRING))) { const QString &title = QString::fromUtf8((const char *)xcb_get_property_value(wm_name), xcb_get_property_value_length(wm_name)); if (title != qt_window_private(window())->windowTitle) { qt_window_private(window())->windowTitle = title; emit window()->windowTitleChanged(title); } } free(wm_name); } void DForeignPlatformWindow::updateWmClass() { xcb_get_property_reply_t *wm_class = xcb_get_property_reply(xcb_connection(), xcb_get_property(xcb_connection(), 0, m_window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0L, 2048L), NULL); if (wm_class && wm_class->format == 8 && wm_class->type == XCB_ATOM_STRING) { const QByteArray wm_class_name((const char *)xcb_get_property_value(wm_class), xcb_get_property_value_length(wm_class)); const QList wm_class_name_list = wm_class_name.split('\0'); if (!wm_class_name_list.isEmpty()) window()->setProperty(WmClass, QString::fromLocal8Bit(wm_class_name_list.first())); } free(wm_class); } void DForeignPlatformWindow::updateWmDesktop() { window()->setProperty(WmNetDesktop, Utility::getWorkspaceForWindow(m_window)); } void DForeignPlatformWindow::updateWindowState() { Qt::WindowState newState = Qt::WindowNoState; const xcb_get_property_cookie_t get_cookie = xcb_get_property(xcb_connection(), 0, m_window, atom(QXcbAtom::D_QXCBATOM_WRAPPER(WM_STATE)), XCB_ATOM_ANY, 0, 1024); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), get_cookie, NULL); if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::D_QXCBATOM_WRAPPER(WM_STATE))) { const quint32 *data = (const quint32 *)xcb_get_property_value(reply); if (reply->length != 0 && XCB_ICCCM_WM_STATE_ICONIC == data[0]) newState = Qt::WindowMinimized; } free(reply); if (newState != Qt::WindowMinimized) { // Something else changed, get _NET_WM_STATE. const NetWmStates states = netWmStates(); if (states & NetWmStateFullScreen) newState = Qt::WindowFullScreen; else if ((states & NetWmStateMaximizedHorz) && (states & NetWmStateMaximizedVert)) newState = Qt::WindowMaximized; } if (m_windowState == newState) return; m_windowState = newState; qt_window_private(window())->windowState = newState; emit window()->windowStateChanged(newState); qt_window_private(window())->updateVisibility(); } void DForeignPlatformWindow::updateWindowTypes() { auto window_types = wmWindowTypes(); Qt::WindowFlags window_flags = Qt::WindowFlags(); #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) typedef QXcbWindow QXcbWindowFunctions ; #endif if (window_types & QXcbWindowFunctions::Normal) window_flags |= Qt::Window; if (window_types & QXcbWindowFunctions::Desktop) window_flags |= Qt::Desktop; if (window_types & QXcbWindowFunctions::Dialog) window_flags |= Qt::Dialog; if (window_types & QXcbWindowFunctions::Utility) window_flags |= Qt::Tool; if (window_types & QXcbWindowFunctions::Tooltip) window_flags |= Qt::ToolTip; if (window_types & QXcbWindowFunctions::Splash) window_flags |= Qt::SplashScreen; // default: Qt::Widget, include dock if (!window_flags) window_flags |= Qt::Widget; if (window_types & QXcbWindowFunctions::KdeOverride) window_flags |= Qt::FramelessWindowHint; qt_window_private(window())->windowFlags = window_flags; window()->setProperty(WmWindowTypes, (quint32)window_types); } void DForeignPlatformWindow::updateProcessId() { xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection(), false, m_window, atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_PID)), XCB_ATOM_CARDINAL, 0, 1); QScopedPointer reply( xcb_get_property_reply(xcb_connection(), cookie, NULL)); if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 1) { window()->setProperty(ProcessId, *(quint32 *)xcb_get_property_value(reply.data())); } } void DForeignPlatformWindow::init() { updateTitle(); updateWindowState(); updateWindowTypes(); updateWmClass(); updateWmDesktop(); updateProcessId(); if (QPlatformScreen * qplatformScreen = screenForGeometry(geometry())) { window()->setScreen(qplatformScreen->screen()); } // m_mapped = Utility::getWindows().contains(m_window); // qt_window_private(window())->visible = m_mapped; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dframewindow.cpp000066400000000000000000001022271476226662200215320ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dframewindow.h" #include "dplatformwindowhelper.h" #include "dplatformintegration.h" #ifdef Q_OS_LINUX #include "dwmsupport.h" #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #endif #include #include #include #include #include #include #include #include #include #include #ifdef Q_OS_LINUX #include #endif DPP_BEGIN_NAMESPACE class Cairo { public: Cairo() { // fix found lib was libcairo2-dev without version number cairo = new QLibrary("cairo", "2"); if (!cairo->load()) { delete cairo; cairo = nullptr; return; } #define INIT_FUN(Name) Name = reinterpret_cast(cairo->resolve(#Name)); Q_ASSERT(Name) INIT_FUN(cairo_image_surface_create_for_data); INIT_FUN(cairo_create); INIT_FUN(cairo_surface_mark_dirty); INIT_FUN(cairo_set_source_rgb); INIT_FUN(cairo_set_source_surface); INIT_FUN(cairo_set_operator); INIT_FUN(cairo_move_to); INIT_FUN(cairo_line_to); INIT_FUN(cairo_curve_to); INIT_FUN(cairo_clip); INIT_FUN(cairo_rectangle); INIT_FUN(cairo_fill); INIT_FUN(cairo_paint); INIT_FUN(cairo_destroy); INIT_FUN(cairo_surface_destroy); INIT_FUN(cairo_xlib_surface_set_drawable); INIT_FUN(cairo_xlib_surface_create); INIT_FUN(cairo_xlib_surface_get_width); INIT_FUN(cairo_xlib_surface_get_height); } ~Cairo() { if (cairo) delete cairo; } bool isValid() const { return cairo; } cairo_surface_t *(*cairo_image_surface_create_for_data)(unsigned char *data, cairo_format_t format, int width, int height, int stride); cairo_t *(*cairo_create)(cairo_surface_t *target); void (*cairo_surface_mark_dirty)(cairo_surface_t *surface); void (*cairo_set_source_rgb)(cairo_t *cr, double red, double green, double blue); void (*cairo_set_source_surface)(cairo_t *cr, cairo_surface_t *surface, double x, double y); void (*cairo_set_operator)(cairo_t *cr, cairo_operator_t op); void (*cairo_move_to)(cairo_t *cr, double x, double y); void (*cairo_line_to)(cairo_t *cr, double x, double y); void (*cairo_curve_to)(cairo_t *cr, double x1, double y1, double x2, double y2, double x3, double y3); void (*cairo_clip)(cairo_t *cr); void (*cairo_rectangle)(cairo_t *cr, double x, double y, double width, double height); void (*cairo_fill)(cairo_t *cr); void (*cairo_paint)(cairo_t *cr); void (*cairo_destroy)(cairo_t *cr); void (*cairo_surface_destroy)(cairo_surface_t *surface); void (*cairo_xlib_surface_set_drawable)(cairo_surface_t *surface, Drawable drawable, int width, int height); cairo_surface_t *(*cairo_xlib_surface_create)(Display *dpy, Drawable drawable, Visual *visual, int width, int height); int (*cairo_xlib_surface_get_width)(cairo_surface_t *surface); int (*cairo_xlib_surface_get_height)(cairo_surface_t *surface); private: QLibrary *cairo = nullptr; }; Q_GLOBAL_STATIC(Cairo, __cairo) class DFrameWindowPrivate : public QPaintDeviceWindowPrivate { Q_DECLARE_PUBLIC(DFrameWindow) public: void resize(const QSize &size) { Q_Q(DFrameWindow); if (this->size == size) return; this->size = size; q->platformBackingStore->resize(size, QRegion()); q->update(); q->drawNativeWindowXPixmap(); } void beginPaint(const QRegion ®ion) Q_DECL_OVERRIDE { Q_Q(DFrameWindow); if (!q->m_redirectContent) { if (size != q->handle()->QPlatformWindow::geometry().size()) { size = q->handle()->QPlatformWindow::geometry().size(); q->platformBackingStore->resize(size, QRegion()); markWindowAsDirty(); } q->platformBackingStore->beginPaint(region * q->devicePixelRatio()); } } void endPaint() Q_DECL_OVERRIDE { Q_Q(DFrameWindow); if (!q->m_redirectContent) q->platformBackingStore->endPaint(); } void flush(const QRegion ®ion) Q_DECL_OVERRIDE { Q_Q(DFrameWindow); if (!q->m_redirectContent) { return q->platformBackingStore->flush(q, region * q->devicePixelRatio(), QPoint(0, 0)); } flushArea += region * q->devicePixelRatio(); if (flushTimer > 0) { return; } flushTimer = q->startTimer(8, Qt::PreciseTimer); } QSize size; int flushTimer = 0; QRegion flushArea; }; QList DFrameWindow::frameWindowList; DFrameWindow::DFrameWindow(QWindow *content) : QPaintDeviceWindow(*new DFrameWindowPrivate(), 0) , platformBackingStore(QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(this)) , m_redirectContent(DPlatformWindowHelper::windowRedirectContent(content)) #ifdef Q_OS_LINUX , m_contentWindow(content) , nativeWindowXPixmap(XCB_PIXMAP_NONE) #endif { setSurfaceType(QSurface::RasterSurface); QSurfaceFormat f = this->format(); f.setAlphaBufferSize(8); setFormat(f); m_cursorAnimation.setDuration(50); m_cursorAnimation.setEasingCurve(QEasingCurve::InExpo); connect(&m_cursorAnimation, &QVariantAnimation::valueChanged, this, [this] (const QVariant &value) { qApp->primaryScreen()->handle()->cursor()->setPos(value.toPoint()); }); m_startAnimationTimer.setSingleShot(true); m_startAnimationTimer.setInterval(300); connect(&m_startAnimationTimer, &QTimer::timeout, this, &DFrameWindow::startCursorAnimation); updateContentMarginsHint(); frameWindowList.append(this); connect(this, &DFrameWindow::windowStateChanged, this, &DFrameWindow::updateMask); connect(&m_updateShadowTimer, &QTimer::timeout, this, &DFrameWindow::updateShadow); } DFrameWindow::~DFrameWindow() { frameWindowList.removeOne(this); #ifdef Q_OS_LINUX if (nativeWindowXSurface) __cairo->cairo_surface_destroy(nativeWindowXSurface); if (nativeWindowXPixmap != XCB_PIXMAP_NONE) xcb_free_pixmap(DPlatformIntegration::xcbConnection()->xcb_connection(), nativeWindowXPixmap); #endif delete platformBackingStore; } QWindow *DFrameWindow::contentWindow() const { return m_contentWindow.data(); } int DFrameWindow::shadowRadius() const { return m_shadowRadius; } void DFrameWindow::setShadowRadius(int radius) { if (m_shadowRadius == radius) return; m_shadowRadius = radius; updateContentMarginsHint(); } QPoint DFrameWindow::shadowOffset() const { return m_shadowOffset; } void DFrameWindow::setShadowOffset(const QPoint &offset) { if (m_shadowOffset == offset) return; m_shadowOffset = offset; updateContentMarginsHint(); } QColor DFrameWindow::shadowColor() const { return m_shadowColor; } void DFrameWindow::setShadowColor(const QColor &color) { if (m_shadowColor == color) return; m_shadowColor = color; updateShadowAsync(); } int DFrameWindow::borderWidth() const { return m_borderWidth; } void DFrameWindow::setBorderWidth(int width) { if (m_borderWidth == width) return; m_borderWidth = width; updateContentMarginsHint(); } QColor DFrameWindow::borderColor() const { return m_borderColor; } void DFrameWindow::setBorderColor(const QColor &color) { if (m_borderColor == color) return; m_borderColor = color; updateShadowAsync(); } QPainterPath DFrameWindow::contentPath() const { return m_clipPathOfContent; } inline static QSize margins2Size(const QMargins &margins) { return QSize(margins.left() + margins.right(), margins.top() + margins.bottom()); } void DFrameWindow::setContentPath(const QPainterPath &path) { setContentPath(path, false); } void DFrameWindow::setContentRoundedRect(const QRect &rect, int radius) { QPainterPath path; path.addRoundedRect(rect, radius, radius); m_contentGeometry = rect.translated(contentOffsetHint()); setContentPath(path, true, radius); } QMargins DFrameWindow::contentMarginsHint() const { return m_contentMarginsHint; } QPoint DFrameWindow::contentOffsetHint() const { return QPoint(m_contentMarginsHint.left(), m_contentMarginsHint.top()); } bool DFrameWindow::isClearContentAreaForShadowPixmap() const { return m_clearContent; } void DFrameWindow::setClearContentAreaForShadowPixmap(bool clear) { if (m_clearContent == clear) return; m_clearContent = clear; if (clear && !m_shadowImage.isNull()) { QPainter pa(&m_shadowImage); pa.setCompositionMode(QPainter::CompositionMode_Clear); pa.setRenderHint(QPainter::Antialiasing); pa.fillPath(m_clipPathOfContent.translated(QPoint(m_shadowRadius, m_shadowRadius) - m_shadowOffset) * devicePixelRatio(), Qt::transparent); pa.end(); } } bool DFrameWindow::isEnableSystemResize() const { return m_enableSystemResize; } void DFrameWindow::setEnableSystemResize(bool enable) { m_enableSystemResize = enable; if (!m_enableSystemResize) Utility::cancelWindowMoveResize(Utility::getNativeTopLevelWindow(winId())); } bool DFrameWindow::isEnableSystemMove() const { #ifdef Q_OS_LINUX if (!m_enableSystemMove) return false; quint32 hints = DXcbWMSupport::getMWMFunctions(Utility::getNativeTopLevelWindow(winId())); return (hints == DXcbWMSupport::MWM_FUNC_ALL || hints & DXcbWMSupport::MWM_FUNC_MOVE); #endif return m_enableSystemMove; } void DFrameWindow::setEnableSystemMove(bool enable) { m_enableSystemMove = enable; if (!m_enableSystemMove) { setCursor(Qt::ArrowCursor); cancelAdsorbCursor(); m_canAdsorbCursor = false; Utility::cancelWindowMoveResize(Utility::getNativeTopLevelWindow(winId())); } } void DFrameWindow::disableRepaintShadow() { m_canUpdateShadow = false; } void DFrameWindow::enableRepaintShadow() { m_canUpdateShadow = true; } bool DFrameWindow::redirectContent() const { return m_redirectContent; } void DFrameWindow::paintEvent(QPaintEvent *) { if (m_redirectContent) { #ifdef Q_OS_LINUX drawNativeWindowXPixmap(); #endif } else { drawShadowTo(this); } } void DFrameWindow::showEvent(QShowEvent *event) { // Set frame extents Utility::setFrameExtents(winId(), contentMarginsHint() * devicePixelRatio()); updateShadow(); QPaintDeviceWindow::showEvent(event); } void DFrameWindow::mouseMoveEvent(QMouseEvent *event) { // 无论如何,在已进入move resize时都不再进行后面的处理,防止触屏移动窗口时会误触进入到窗口resize状态 if (m_isSystemMoveResizeState && qApp->mouseButtons() == Qt::LeftButton) { Utility::updateMousePointForWindowMove(Utility::getNativeTopLevelWindow(winId())); return; } if (event->source() == Qt::MouseEventSynthesizedByQt && qApp->mouseButtons() == Qt::LeftButton && m_clipPathOfContent.contains(event->pos() - contentOffsetHint())) { if (!isEnableSystemMove()) return; ///TODO: Warning: System move finished no mouse release event Utility::startWindowSystemMove(Utility::getNativeTopLevelWindow(winId())); m_isSystemMoveResizeState = true; return; } unsetCursor(); if (!canResize()) return; if (qApp->mouseButtons() != Qt::LeftButton && m_contentGeometry.contains(event->pos())) { return; } bool isFixedWidth = minimumWidth() == maximumWidth(); bool isFixedHeight = minimumHeight() == maximumHeight(); Utility::CornerEdge mouseCorner; QRect cornerRect; const QRect window_real_geometry = m_contentGeometry + QMargins(MOUSE_MARGINS, MOUSE_MARGINS, MOUSE_MARGINS, MOUSE_MARGINS); if (isFixedWidth || isFixedHeight) goto set_edge; /// begin set cursor corner type cornerRect.setSize(QSize(MOUSE_MARGINS * 2, MOUSE_MARGINS * 2)); cornerRect.moveTopLeft(window_real_geometry.topLeft()); if (cornerRect.contains(event->pos())) { mouseCorner = Utility::TopLeftCorner; goto set_cursor; } cornerRect.moveTopRight(window_real_geometry.topRight()); if (cornerRect.contains(event->pos())) { mouseCorner = Utility::TopRightCorner; goto set_cursor; } cornerRect.moveBottomRight(window_real_geometry.bottomRight()); if (cornerRect.contains(event->pos())) { mouseCorner = Utility::BottomRightCorner; goto set_cursor; } cornerRect.moveBottomLeft(window_real_geometry.bottomLeft()); if (cornerRect.contains(event->pos())) { mouseCorner = Utility::BottomLeftCorner; goto set_cursor; } set_edge: /// begin set cursor edge type if (event->x() <= m_contentGeometry.x()) { if (isFixedWidth) goto skip_set_cursor; mouseCorner = Utility::LeftEdge; } else if (event->x() < m_contentGeometry.right()) { if (isFixedHeight) goto skip_set_cursor; if (event->y() <= m_contentGeometry.y()) { mouseCorner = Utility::TopEdge; } else if (!isFixedWidth || event->y() >= m_contentGeometry.bottom()) { mouseCorner = Utility::BottomEdge; } else { goto skip_set_cursor; } } else if (!isFixedWidth && (!isFixedHeight || event->x() >= m_contentGeometry.right())) { mouseCorner = Utility::RightEdge; } else { goto skip_set_cursor; } set_cursor: Utility::setWindowCursor(winId(), mouseCorner); if (qApp->mouseButtons() == Qt::LeftButton) { Utility::startWindowSystemResize(Utility::getNativeTopLevelWindow(winId()), mouseCorner); m_isSystemMoveResizeState = true; cancelAdsorbCursor(); } else { adsorbCursor(mouseCorner); } return; skip_set_cursor: setCursor(Qt::ArrowCursor); cancelAdsorbCursor(); m_canAdsorbCursor = canResize(); } void DFrameWindow::mouseReleaseEvent(QMouseEvent *event) { if (m_isSystemMoveResizeState) { Utility::cancelWindowMoveResize(Utility::getNativeTopLevelWindow(winId())); m_isSystemMoveResizeState = false; } return QPaintDeviceWindow::mouseReleaseEvent(event); } void DFrameWindow::resizeEvent(QResizeEvent *event) { updateFrameMask(); return QPaintDeviceWindow::resizeEvent(event); } bool DFrameWindow::event(QEvent *event) { switch (event->type()) { case QEvent::Enter: m_canAdsorbCursor = canResize(); break; case QEvent::Leave: m_canAdsorbCursor = false; cancelAdsorbCursor(); break; default: break; } return QPaintDeviceWindow::event(event); } void DFrameWindow::timerEvent(QTimerEvent *event) { Q_D(DFrameWindow); if (event->timerId() == d->flushTimer) { killTimer(d->flushTimer); d->flushTimer = 0; if (!d->flushArea.isEmpty()) { platformBackingStore->flush(this, d->flushArea, QPoint(0, 0)); d->flushArea = QRegion(); } } else if (event->timerId() == m_paintShadowOnContentTimerId) { killTimer(m_paintShadowOnContentTimerId); m_paintShadowOnContentTimerId = -1; if (!m_contentWindow || !m_contentWindow->handle()) return QPaintDeviceWindow::timerEvent(event); QRect rect = m_contentWindow->handle()->geometry(); rect.setTopLeft(QPoint(0, 0)); m_contentBackingStore->flush(m_contentWindow, rect, QPoint(0, 0)); } else { return QPaintDeviceWindow::timerEvent(event); } } #ifdef Q_OS_LINUX static cairo_format_t cairo_format_from_qimage_format (QImage::Format fmt) { switch (fmt) { case QImage::Format_ARGB32_Premultiplied: return CAIRO_FORMAT_ARGB32; case QImage::Format_RGB32: return CAIRO_FORMAT_RGB24; case QImage::Format_Indexed8: // XXX not quite return CAIRO_FORMAT_A8; case QImage::Format_Mono: case QImage::Format_MonoLSB: return CAIRO_FORMAT_A1; case QImage::Format_RGB16: return CAIRO_FORMAT_RGB16_565; case QImage::Format_RGB30: case QImage::Format_A2RGB30_Premultiplied: // 忽略2 bits的alpha通道 return CAIRO_FORMAT_RGB30; case QImage::Format_Invalid: case QImage::Format_ARGB32: case QImage::Format_ARGB8565_Premultiplied: case QImage::Format_RGB666: case QImage::Format_ARGB6666_Premultiplied: case QImage::Format_RGB555: case QImage::Format_ARGB8555_Premultiplied: case QImage::Format_RGB888: case QImage::Format_RGB444: case QImage::Format_ARGB4444_Premultiplied: case QImage::NImageFormats: default: return (cairo_format_t) -1; } } #endif void DFrameWindow::updateFromContents(void *ev) { #ifdef Q_OS_LINUX if (Q_UNLIKELY(nativeWindowXPixmap == XCB_PIXMAP_NONE && xsurfaceDirtySize.isEmpty())) { return; } xcb_connection_t *connect = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_damage_notify_event_t *event = reinterpret_cast(ev); xcb_xfixes_region_t parts = xcb_generate_id(connect); xcb_xfixes_create_region(connect, parts, 0, 0); xcb_damage_subtract(connect, event->damage, XCB_NONE, parts); xcb_xfixes_fetch_region_cookie_t cookie = xcb_xfixes_fetch_region(connect, parts); xcb_xfixes_fetch_region_reply_t *reply = xcb_xfixes_fetch_region_reply(connect, cookie, 0); if (Q_UNLIKELY(!reply)) return; xcb_rectangle_t *rectangles = xcb_xfixes_fetch_region_rectangles(reply); int length = xcb_xfixes_fetch_region_rectangles_length(reply); if (!xsurfaceDirtySize.isEmpty()) updateNativeWindowXPixmap(xsurfaceDirtySize.width(), xsurfaceDirtySize.height()); drawNativeWindowXPixmap(rectangles, length); free(reply); #endif } void DFrameWindow::drawShadowTo(QPaintDevice *device) { const QPoint &offset = m_contentGeometry.topLeft() - contentOffsetHint(); qreal device_pixel_ratio = devicePixelRatio(); const QSize &size = handle()->geometry().size(); QPainter pa(device); if (m_redirectContent) { QPainterPath clip_path; clip_path.addRect(QRect(QPoint(0, 0), size)); clip_path -= m_clipPath; pa.setRenderHint(QPainter::Antialiasing); pa.setClipPath(clip_path); } pa.setCompositionMode(QPainter::CompositionMode_Source); if (!disableFrame() && Q_LIKELY(DXcbWMSupport::instance()->hasWindowAlpha()) && !m_shadowImage.isNull()) { pa.drawImage(offset * device_pixel_ratio, m_shadowImage); } if (m_borderWidth > 0 && m_borderColor != Qt::transparent) { if (Q_LIKELY(DXcbWMSupport::instance()->hasWindowAlpha())) { pa.setRenderHint(QPainter::Antialiasing); pa.fillPath(m_borderPath, m_borderColor); } else { pa.fillRect(QRect(QPoint(0, 0), size), m_borderColor); } } pa.end(); } QPaintDevice *DFrameWindow::redirected(QPoint *) const { return platformBackingStore->paintDevice(); } void DFrameWindow::setContentPath(const QPainterPath &path, bool isRoundedRect, int radius) { if (m_clipPathOfContent == path) return; if (!isRoundedRect) m_contentGeometry = path.boundingRect().toRect().translated(contentOffsetHint()); qreal device_pixel_ratio = devicePixelRatio(); m_clipPathOfContent = path; m_clipPath = path.translated(contentOffsetHint()) * device_pixel_ratio; if (isRoundedRect && m_pathIsRoundedRect == isRoundedRect && m_roundedRectRadius == radius && !m_shadowImage.isNull()) { const QMargins margins(qMax(m_shadowRadius + radius + qAbs(m_shadowOffset.x()), m_borderWidth), qMax(m_shadowRadius + radius + qAbs(m_shadowOffset.y()), m_borderWidth), qMax(m_shadowRadius + radius + qAbs(m_shadowOffset.x()), m_borderWidth), qMax(m_shadowRadius + radius + qAbs(m_shadowOffset.y()), m_borderWidth)); const QSize &margins_size = margins2Size(margins); const QSize &shadow_size = m_shadowImage.size() / device_pixel_ratio; if (margins_size.width() > m_contentGeometry.width() || margins_size.height() > m_contentGeometry.height() || margins_size.width() >= shadow_size.width() || margins_size.height() >= shadow_size.height()) { updateShadowAsync(); } else if (m_canUpdateShadow && !m_contentGeometry.isEmpty() && isVisible() && !disableFrame()) { m_shadowImage = Utility::borderImage(QPixmap::fromImage(m_shadowImage), margins * device_pixel_ratio, (m_contentGeometry + contentMarginsHint()).size() * device_pixel_ratio); } } else { m_pathIsRoundedRect = isRoundedRect; m_roundedRectRadius = radius; updateShadowAsync(); } updateMask(); } #ifdef Q_OS_LINUX void DFrameWindow::drawNativeWindowXPixmap(xcb_rectangle_t *rects, int length) { if (Q_UNLIKELY(!nativeWindowXSurface)) return; const QPoint offset(m_contentMarginsHint.left() * devicePixelRatio(), m_contentMarginsHint.top() * devicePixelRatio()); const QImage &source_image = platformBackingStore->toImage(); QImage image(const_cast(source_image.bits()), source_image.width(), source_image.height(), source_image.bytesPerLine(), source_image.format()); const cairo_format_t format = cairo_format_from_qimage_format(image.format()); cairo_surface_t *surface = __cairo->cairo_image_surface_create_for_data(image.bits(), format, image.width(), image.height(), image.bytesPerLine()); cairo_t *cr = __cairo->cairo_create(surface); __cairo->cairo_surface_mark_dirty(nativeWindowXSurface); __cairo->cairo_set_source_rgb(cr, 0, 255, 0); __cairo->cairo_set_source_surface(cr, nativeWindowXSurface, offset.x(), offset.y()); __cairo->cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); bool clip = false; for (int i = 0; i < m_clipPath.elementCount(); ++i) { const QPainterPath::Element &e = m_clipPath.elementAt(i); switch (e.type) { case QPainterPath::MoveToElement: clip = true; __cairo->cairo_move_to(cr, e.x, e.y); break; case QPainterPath::LineToElement: clip = true; __cairo->cairo_line_to(cr, e.x, e.y); break; case QPainterPath::CurveToElement: { clip = true; const QPainterPath::Element &p2 = m_clipPath.elementAt(++i); const QPainterPath::Element &p3 = m_clipPath.elementAt(++i); __cairo->cairo_curve_to(cr, e.x, e.y, p2.x, p2.y, p3.x, p3.y); break; } default: break; } } if (clip) { __cairo->cairo_clip(cr); } if (rects) { for (int i = 0; i < length; ++i) { const xcb_rectangle_t &rect = rects[i]; d_func()->flushArea += QRect(rect.x + offset.x(), rect.y + offset.y(), rect.width, rect.height); __cairo->cairo_rectangle(cr, rect.x + offset.x(), rect.y + offset.y(), rect.width, rect.height); __cairo->cairo_fill(cr); } } else { __cairo->cairo_paint(cr); // draw shadow drawShadowTo(&image); d_func()->flushArea = QRect(QPoint(0, 0), d_func()->size); } __cairo->cairo_destroy(cr); __cairo->cairo_surface_destroy(surface); d_func()->flush(QRegion()); } bool DFrameWindow::updateNativeWindowXPixmap(int width, int height) { if (Q_UNLIKELY(!m_contentWindow->handle()->isExposed())) return false; WId winId = static_cast(m_contentWindow->handle())->QXcbWindow::winId(); qreal width_extra = (m_contentMarginsHint.left() + m_contentMarginsHint.right()) * devicePixelRatio(); qreal height_extra = (m_contentMarginsHint.top() + m_contentMarginsHint.bottom()) * devicePixelRatio(); d_func()->resize(QSize(width + qRound(width_extra), height + qRound(height_extra))); xcb_connection_t *connect = DPlatformIntegration::xcbConnection()->xcb_connection(); if (Q_LIKELY(nativeWindowXPixmap != XCB_PIXMAP_NONE)) { xcb_free_pixmap(connect, nativeWindowXPixmap); } else { nativeWindowXPixmap = xcb_generate_id(connect); } xcb_void_cookie_t cookie = xcb_composite_name_window_pixmap_checked(connect, winId, nativeWindowXPixmap); QScopedPointer error(xcb_request_check(connect, cookie)); if (error) { nativeWindowXPixmap = XCB_PIXMAP_NONE; return false; } if (Q_LIKELY(nativeWindowXSurface)) { __cairo->cairo_xlib_surface_set_drawable(nativeWindowXSurface, nativeWindowXPixmap, width, height); } else if (__cairo->isValid()) { Display *display = (Display*)DPlatformIntegration::xcbConnection()->xlib_display(); XWindowAttributes attr; XGetWindowAttributes(display, winId, &attr); //###(zccrs): 只能使用cairo的xlib接口,使用xcb接口会导致从创建的surface中读取内容时不正确 nativeWindowXSurface = __cairo->cairo_xlib_surface_create(display, nativeWindowXPixmap, attr.visual, attr.width, attr.height); } return true; } void DFrameWindow::markXPixmapToDirty(int width, int height) { if (Q_UNLIKELY(width < 0 || height < 0)) { WId winId = static_cast(m_contentWindow->handle())->QXcbWindow::winId(); const QRect rect = Utility::windowGeometry(winId); width = rect.width(); height = rect.height(); } xsurfaceDirtySize.setWidth(width); xsurfaceDirtySize.setHeight(height); } #endif void DFrameWindow::updateShadow() { if (!isVisible()) return; if (!m_canUpdateShadow || m_contentGeometry.isEmpty() || disableFrame()) return; qreal device_pixel_ratio = devicePixelRatio(); QPixmap pixmap(m_contentGeometry.size() * device_pixel_ratio); if (pixmap.isNull()) return; pixmap.fill(Qt::transparent); QPainter pa(&pixmap); pa.fillPath(m_clipPath.translated(-m_contentGeometry.topLeft() * device_pixel_ratio), m_shadowColor); pa.end(); m_shadowImage = Utility::dropShadow(pixmap, m_shadowRadius * device_pixel_ratio, m_shadowColor); update(); // 阴影更新后尝试刷新内部窗口 if (m_contentBackingStore) m_paintShadowOnContentTimerId = startTimer(300, Qt::PreciseTimer); } void DFrameWindow::updateShadowAsync(int delaye) { if (m_updateShadowTimer.isActive()) { return; } m_updateShadowTimer.setSingleShot(true); m_updateShadowTimer.start(delaye); } void DFrameWindow::updateContentMarginsHint(bool force) { QMargins margins; margins = QMargins(qMax(m_shadowRadius - m_shadowOffset.x(), m_borderWidth), qMax(m_shadowRadius - m_shadowOffset.y(), m_borderWidth), qMax(m_shadowRadius + m_shadowOffset.x(), m_borderWidth), qMax(m_shadowRadius + m_shadowOffset.y(), m_borderWidth)); if (!force && margins == m_contentMarginsHint) return; qreal device_pixel_ratio = devicePixelRatio(); Utility::setFrameExtents(winId(), margins * device_pixel_ratio); const QMargins old_margins = m_contentMarginsHint; m_contentMarginsHint = margins; m_contentGeometry.translate(m_contentMarginsHint.left() - old_margins.left(), m_contentMarginsHint.top() - old_margins.top()); m_clipPath = m_clipPathOfContent.translated(contentOffsetHint()) * device_pixel_ratio; qreal width_extra = (m_contentMarginsHint.left() + m_contentMarginsHint.right()) * device_pixel_ratio; qreal height_extra = (m_contentMarginsHint.top() + m_contentMarginsHint.bottom()) * device_pixel_ratio; #ifdef Q_OS_LINUX if (nativeWindowXSurface) { int width = __cairo->cairo_xlib_surface_get_width(nativeWindowXSurface); int height = __cairo->cairo_xlib_surface_get_height(nativeWindowXSurface); d_func()->resize(QSize(width + qRound(width_extra), height + qRound(height_extra))); } #endif updateShadow(); updateMask(); emit contentMarginsHintChanged(old_margins); } void DFrameWindow::updateMask() { if (windowState() == Qt::WindowMinimized) return; if (disableFrame()) { QRegion region(m_contentGeometry * devicePixelRatio()); Utility::setShapeRectangles(winId(), region, DWMSupport::instance()->hasWindowAlpha(), flags().testFlag(Qt::WindowTransparentForInput)); return; } // Set window clip mask int mouse_margins; if (DWMSupport::instance()->hasWindowAlpha()) mouse_margins = canResize() ? MOUSE_MARGINS : 0; else mouse_margins = qRound(m_borderWidth * devicePixelRatio()); const QPainterPath &path = m_clipPath; if (m_enableAutoInputMaskByContentPath && (!m_pathIsRoundedRect || m_roundedRectRadius > 0)) { QPainterPath p; if (Q_LIKELY(mouse_margins > 0)) { QPainterPathStroker stroker; stroker.setJoinStyle(Qt::MiterJoin); stroker.setWidth(mouse_margins * 2); p = stroker.createStroke(path); p = p.united(path); } else { p = path; } Utility::setShapePath(winId(), p, DWMSupport::instance()->hasWindowAlpha(), flags().testFlag(Qt::WindowTransparentForInput)); } else { QRegion region((m_contentGeometry * devicePixelRatio()).adjusted(-mouse_margins, -mouse_margins, mouse_margins, mouse_margins)); Utility::setShapeRectangles(winId(), region, DWMSupport::instance()->hasWindowAlpha(), flags().testFlag(Qt::WindowTransparentForInput)); } QPainterPathStroker stroker; stroker.setJoinStyle(Qt::MiterJoin); stroker.setWidth(m_borderWidth); m_borderPath = stroker.createStroke(path); updateFrameMask(); update(); } void DFrameWindow::updateFrameMask() { #ifdef Q_OS_LINUX // QXcbWindow *xw = static_cast(handle()); // if (!xw || !xw->wmWindowTypes().testFlag(QXcbWindowFunctions::Dock)) // return; // if (!m_enableAutoFrameMask || !DWMSupport::instance()->hasWindowAlpha()) // return; // const QRect rect(QRect(QPoint(0, 0), size())); // QRegion region(rect.united((m_contentGeometry + contentMarginsHint())) * devicePixelRatio()); // ###(zccrs): xfwm4 window manager会自动给dock类型的窗口加上阴影, 所以在此裁掉窗口之外的内容 // setMask(region); #endif } bool DFrameWindow::canResize() const { bool ok = m_enableSystemResize && !flags().testFlag(Qt::Popup) && !flags().testFlag(Qt::BypassWindowManagerHint) && minimumSize() != maximumSize() && !disableFrame(); #ifdef Q_OS_LINUX if (!ok) return false; quint32 hints = DXcbWMSupport::getMWMFunctions(Utility::getNativeTopLevelWindow(winId())); return (hints == DXcbWMSupport::MWM_FUNC_ALL || hints & DXcbWMSupport::MWM_FUNC_RESIZE); #endif return ok; } void DFrameWindow::cancelAdsorbCursor() { QSignalBlocker blocker(&m_startAnimationTimer); Q_UNUSED(blocker) m_startAnimationTimer.stop(); m_cursorAnimation.stop(); } void DFrameWindow::adsorbCursor(Utility::CornerEdge cornerEdge) { m_lastCornerEdge = cornerEdge; if (!m_canAdsorbCursor) return; if (m_cursorAnimation.state() == QVariantAnimation::Running) return; m_startAnimationTimer.start(); } void DFrameWindow::startCursorAnimation() { const QPoint &cursorPos = qApp->primaryScreen()->handle()->cursor()->pos(); QPoint toPos = cursorPos - handle()->geometry().topLeft(); const QRect geometry = (m_contentGeometry * devicePixelRatioF()).adjusted(-2, -2, 2, 2); switch (m_lastCornerEdge) { case Utility::TopLeftCorner: toPos = geometry.topLeft(); break; case Utility::TopEdge: toPos.setY(geometry.y()); break; case Utility::TopRightCorner: toPos = geometry.topRight(); break; case Utility::RightEdge: toPos.setX(geometry.right()); break; case Utility::BottomRightCorner: toPos = geometry.bottomRight(); break; case Utility::BottomEdge: toPos.setY(geometry.bottom()); break; case Utility::BottomLeftCorner: toPos = geometry.bottomLeft(); break; case Utility::LeftEdge: toPos.setX(geometry.x()); break; default: break; } toPos += handle()->geometry().topLeft(); const QPoint &tmp = toPos - cursorPos; if (qAbs(tmp.x()) < 3 && qAbs(tmp.y()) < 3) return; m_canAdsorbCursor = false; m_cursorAnimation.setStartValue(cursorPos); m_cursorAnimation.setEndValue(toPos); m_cursorAnimation.start(); } bool DFrameWindow::disableFrame() const { return windowState() == Qt::WindowFullScreen || windowState() == Qt::WindowMaximized || windowState() == Qt::WindowMinimized; } void DFrameWindow::onDevicePixelRatioChanged() { updateContentMarginsHint(true); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dframewindow.h000066400000000000000000000112341476226662200211740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DFRAMEWINDOW_H #define DFRAMEWINDOW_H #include "global.h" #include "utility.h" #include #include #include #include #ifdef Q_OS_LINUX #include struct xcb_rectangle_t; #endif QT_BEGIN_NAMESPACE class QPlatformBackingStore; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DFrameWindowPrivate; class DFrameWindow : public QPaintDeviceWindow { Q_OBJECT Q_DECLARE_PRIVATE(DFrameWindow) public: explicit DFrameWindow(QWindow *content); ~DFrameWindow(); QWindow *contentWindow() const; int shadowRadius() const; void setShadowRadius(int radius); QPoint shadowOffset() const; void setShadowOffset(const QPoint &offset); QColor shadowColor() const; void setShadowColor(const QColor &color); int borderWidth() const; void setBorderWidth(int width); QColor borderColor() const; void setBorderColor(const QColor &color); QPainterPath contentPath() const; void setContentPath(const QPainterPath &path); void setContentRoundedRect(const QRect &rect, int radius = 0); QMargins contentMarginsHint() const; QPoint contentOffsetHint() const; bool isClearContentAreaForShadowPixmap() const; void setClearContentAreaForShadowPixmap(bool clear); bool isEnableSystemResize() const; void setEnableSystemResize(bool enable); bool isEnableSystemMove() const; void setEnableSystemMove(bool enable); void disableRepaintShadow(); void enableRepaintShadow(); bool redirectContent() const; signals: void contentMarginsHintChanged(const QMargins &oldMargins) const; protected: void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; void showEvent(QShowEvent *event) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; bool event(QEvent *event) Q_DECL_OVERRIDE; void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; void updateFromContents(void *); void drawShadowTo(QPaintDevice *device); private: QPaintDevice *redirected(QPoint *) const Q_DECL_OVERRIDE; void setContentPath(const QPainterPath &path, bool isRoundedRect, int radius = 0); #ifdef Q_OS_LINUX void drawNativeWindowXPixmap(xcb_rectangle_t *rects = 0, int length = 0); bool updateNativeWindowXPixmap(int width, int height); void markXPixmapToDirty(int width = -1, int height = -1); #endif void updateShadow(); void updateShadowAsync(int delaye = 30); void updateContentMarginsHint(bool force = false); void updateMask(); void updateFrameMask(); bool canResize() const; void cancelAdsorbCursor(); void adsorbCursor(Utility::CornerEdge cornerEdge); void startCursorAnimation(); bool disableFrame() const; void onDevicePixelRatioChanged(); static QList frameWindowList; QPlatformBackingStore *platformBackingStore; QImage m_shadowImage; bool m_clearContent = false; bool m_redirectContent = false; int m_shadowRadius = 60; QPoint m_shadowOffset = QPoint(0, 16); QColor m_shadowColor = QColor(0, 0, 0, 255 * 0.6); int m_borderWidth = 1; QColor m_borderColor = QColor(0, 0, 0, 255 * 0.15); QPainterPath m_clipPathOfContent; QPainterPath m_clipPath; QPainterPath m_borderPath; QRect m_contentGeometry; QMargins m_contentMarginsHint; bool m_pathIsRoundedRect = true; int m_roundedRectRadius = 0; bool m_enableSystemResize = true; bool m_enableSystemMove = true; bool m_enableAutoInputMaskByContentPath = true; bool m_enableAutoFrameMask = true; bool m_canUpdateShadow = true; bool m_canAdsorbCursor = false; bool m_isSystemMoveResizeState = false; Utility::CornerEdge m_lastCornerEdge; QTimer m_startAnimationTimer; QVariantAnimation m_cursorAnimation; QPointer m_contentWindow; QPlatformBackingStore *m_contentBackingStore = nullptr; QTimer m_updateShadowTimer; int m_paintShadowOnContentTimerId = -1; #ifdef Q_OS_LINUX uint32_t nativeWindowXPixmap = 0; cairo_surface_t *nativeWindowXSurface = 0; QSize xsurfaceDirtySize; #endif friend class DPlatformWindowHelper; friend class DPlatformBackingStoreHelper; friend class DPlatformOpenGLContextHelper; friend class DPlatformIntegration; friend class WindowEventHook; friend class DXcbWMSupport; friend class DFrameWindowPrivate; friend class XcbNativeEventFilter; }; DPP_END_NAMESPACE #endif // DFRAMEWINDOW_H qt5platform-plugins-5.7.12/xcb/dhighdpi.cpp000066400000000000000000000126201476226662200206210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dhighdpi.h" #include "vtablehook.h" #include "dxcbxsettings.h" #include "dplatformintegration.h" #include "qxcbscreen.h" #include "qxcbwindow.h" #include "qxcbbackingstore.h" #include #include #include #include DPP_BEGIN_NAMESPACE bool DHighDpi::active = false; #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) QHash DHighDpi::screenFactorMap; #endif QPointF DHighDpi::fromNativePixels(const QPointF &pixelPoint, const QWindow *window) { return QHighDpi::fromNativePixels(pixelPoint, window); } inline static void init() { // 禁用platform theme中的缩放机制 // 当DHighDpi存在时不应该再使用这个过时的机制 qputenv("D_DISABLE_RT_SCREEN_SCALE", "1"); DHighDpi::init(); } // 在插件被加载时先做一次初始化 Q_CONSTRUCTOR_FUNCTION(init) void DHighDpi::init() { if (QGuiApplication::testAttribute(Qt::AA_DisableHighDpiScaling) // 可以禁用此行为 || qEnvironmentVariableIsSet("D_DXCB_DISABLE_OVERRIDE_HIDPI") // 无有效的xsettings时禁用 || !DXcbXSettings::getOwner()) { // init函数可能会被重复调用, 此处应该清理VtableHook if (active) { #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) VtableHook::resetVfptrFun(&QXcbScreen::pixelDensity); #endif VtableHook::resetVfptrFun(&QXcbScreen::logicalDpi); active = false; } return; } // 设置为完全控制缩放比例,避免被Qt“4舍5入”了缩放比 qputenv("QT_SCALE_FACTOR_ROUNDING_POLICY", "PassThrough"); // 强制开启使用DXCB的缩放机制,此时移除会影响此功能的所有Qt环境变量 if (qEnvironmentVariableIsSet("D_DXCB_FORCE_OVERRIDE_HIDPI")) { qunsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); qunsetenv("QT_SCALE_FACTOR"); qunsetenv("QT_SCREEN_SCALE_FACTORS"); qunsetenv("QT_ENABLE_HIGHDPI_SCALING"); qunsetenv("QT_USE_PHYSICAL_DPI"); } if (!QGuiApplication::testAttribute(Qt::AA_EnableHighDpiScaling)) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QHighDpiScaling::initHighDpiScaling(); } #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) active = VtableHook::overrideVfptrFun(&QXcbScreen::pixelDensity, pixelDensity); if (active) { VtableHook::overrideVfptrFun(&QXcbScreen::logicalDpi, logicalDpi); } #else active = VtableHook::overrideVfptrFun(&QXcbScreen::logicalDpi, logicalDpi); #endif } bool DHighDpi::isActive() { return active; } bool DHighDpi::overrideBackingStore() { // 默认不开启,会降低绘图效率 static bool enabled = qEnvironmentVariableIsSet("D_DXCB_HIDPI_BACKINGSTORE"); return enabled; } QDpi DHighDpi::logicalDpi(QXcbScreen *s) { static bool dpi_env_set = qEnvironmentVariableIsSet("QT_FONT_DPI"); // 遵循环境变量的设置 if (dpi_env_set) { return s->QXcbScreen::logicalDpi(); } int dpi = 0; const QString screenName(QString("Qt/DPI/%1").arg(s->name())); QVariant value = DPlatformIntegration::xSettings(s->connection())->setting(screenName.toLocal8Bit()); bool ok = false; dpi = value.toInt(&ok); // fallback if (!ok) { value = DPlatformIntegration::xSettings(s->connection())->setting("Xft/DPI"); dpi = value.toInt(&ok); } // fallback if (!ok || dpi == 0) { qWarning() << "dpi is invalid got from xsettings(Qt/DPI/ and Xft/DPI), " "fallback to get dpi from QXcbScreen::logicalDpi()"; return s->QXcbScreen::logicalDpi(); } qreal d = dpi / 1024.0; return QDpi(d, d); } #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) qreal DHighDpi::pixelDensity(QXcbScreen *s) { qreal scale = screenFactorMap.value(s, 0); if (qIsNull(scale)) { scale = s->logicalDpi().first / 96.0; screenFactorMap[s] = scale; } return scale; } #endif qreal DHighDpi::devicePixelRatio(QPlatformWindow *w) { qreal base_factor = QHighDpiScaling::factor(w->screen()); return qCeil(base_factor) / base_factor; } void DHighDpi::onDPIChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle) { static bool dynamic_dpi = qEnvironmentVariableIsSet("D_DXCB_RT_HIDPI"); if (!dynamic_dpi) return; Q_UNUSED(connection) Q_UNUSED(name) // 判断值是否有效 if (!property.isValid()) return; qInfo() << Q_FUNC_INFO << name << property; // 清理过期的屏幕缩放值 #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) if (QScreen *screen = reinterpret_cast(handle)) { screenFactorMap.remove(screen->handle()); } else { screenFactorMap.clear(); #else { #endif // 刷新所有窗口 for (QWindow *window : qGuiApp->allWindows()) { if (window->type() == Qt::Desktop) continue; // 更新窗口大小 if (window->handle()) { QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window)); QGuiApplicationPrivate::processGeometryChangeEvent(&gce); } } } } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dhighdpi.h000066400000000000000000000022011476226662200202600ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DHIGHDPI_H #define DHIGHDPI_H #include "global.h" #include #include #include QT_BEGIN_NAMESPACE class QWindow; class QXcbScreen; class QXcbVirtualDesktop; class QPlatformWindow; class QXcbBackingStore; QT_END_NAMESPACE typedef struct xcb_connection_t xcb_connection_t; DPP_BEGIN_NAMESPACE class DHighDpi { public: static QPointF fromNativePixels(const QPointF &pixelPoint, const QWindow *window); static void init(); static bool isActive(); static bool overrideBackingStore(); static QDpi logicalDpi(QXcbScreen *s); #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) static qreal pixelDensity(QXcbScreen *s); #endif static qreal devicePixelRatio(QPlatformWindow *w); static void onDPIChanged(xcb_connection_t *screen, const QByteArray &name, const QVariant &property, void *handle); private: static bool active; static QHash screenFactorMap; }; DPP_END_NAMESPACE #endif // DHIGHDPI_H qt5platform-plugins-5.7.12/xcb/dnotitlebarwindowhelper.cpp000066400000000000000000000533621476226662200240100ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #define protected public #include #undef protected #include "dnotitlebarwindowhelper.h" #include "vtablehook.h" #include "utility.h" #include "dwmsupport.h" #include "dnativesettings.h" #include "dplatformintegration.h" #include #include #include #include #include #include #include #define _DEEPIN_SCISSOR_WINDOW "_DEEPIN_SCISSOR_WINDOW" Q_DECLARE_METATYPE(QPainterPath) extern QWidget *qt_button_down; DPP_BEGIN_NAMESPACE QHash DNoTitlebarWindowHelper::mapped; static QHash g_pressPoint; DNoTitlebarWindowHelper::DNoTitlebarWindowHelper(QWindow *window, quint32 windowID) : QObject(window) , m_window(window) , m_windowID(windowID) { // 不允许设置窗口为无边框的 if (window->flags().testFlag(Qt::FramelessWindowHint)) window->setFlags(window->flags() & ~Qt::FramelessWindowHint); mapped[window] = this; m_nativeSettingsValid = DPlatformIntegration::buildNativeSettings(this, windowID); Q_ASSERT(m_nativeSettingsValid); // 本地设置无效时不可更新窗口属性,否则会导致setProperty函数被循环调用 if (m_nativeSettingsValid) { updateClipPathFromProperty(); updateFrameMaskFromProperty(); updateWindowRadiusFromProperty(); updateBorderWidthFromProperty(); updateBorderColorFromProperty(); updateShadowRadiusFromProperty(); updateShadowOffsetFromProperty(); updateShadowColorFromProperty(); updateWindowEffectFromProperty(); updateWindowStartUpEffectFromProperty(); updateEnableSystemResizeFromProperty(); updateEnableSystemMoveFromProperty(); updateEnableBlurWindowFromProperty(); updateWindowBlurAreasFromProperty(); updateWindowBlurPathsFromProperty(); updateAutoInputMaskByClipPathFromProperty(); } else { qWarning() << "native settings is invalid for window: 0x" << /*hex <<*/ windowID; } connect(DWMSupport::instance(), &DXcbWMSupport::hasScissorWindowChanged, this, &DNoTitlebarWindowHelper::updateWindowShape); connect(DWMSupport::instance(), &DXcbWMSupport::hasBlurWindowChanged, this, [this] (bool blur) { // 检测到窗口管理器支持模糊时,应该重新更新模糊属性。否则可能会导致模糊失效,如kwin在某些情况下可能会删除窗口的模糊属性 if (blur) { updateWindowBlurAreasForWM(); } }); connect(window, &QWindow::widthChanged, this, &DNoTitlebarWindowHelper::onWindowSizeChanged); connect(window, &QWindow::heightChanged, this, &DNoTitlebarWindowHelper::onWindowSizeChanged); } DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper() { g_pressPoint.remove(this); if (VtableHook::hasVtable(m_window)) { VtableHook::resetVtable(m_window); } mapped.remove(static_cast(parent())); if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性 Utility::clearWindowProperty(m_windowID, Utility::internAtom(_DEEPIN_SCISSOR_WINDOW)); DPlatformIntegration::clearNativeSettings(m_windowID); } } void DNoTitlebarWindowHelper::setWindowProperty(QWindow *window, const char *name, const QVariant &value) { const QVariant &old_value = window->property(name); if (old_value == value) return; if (value.typeName() == QByteArray("QPainterPath")) { const QPainterPath &old_path = qvariant_cast(old_value); const QPainterPath &new_path = qvariant_cast(value); if (old_path == new_path) { return; } } window->setProperty(name, value); if (DNoTitlebarWindowHelper *self = mapped.value(window)) { // 本地设置无效时不可更新窗口属性,否则会导致setProperty函数被循环调用 if (!self->m_nativeSettingsValid) { return; } QByteArray name_array(name); if (!name_array.startsWith("_d_")) return; // to upper name_array[3] = name_array.at(3) & ~0x20; const QByteArray slot_name = "update" + name_array.mid(3) + "FromProperty"; if (!QMetaObject::invokeMethod(self, slot_name.constData(), Qt::DirectConnection)) { qWarning() << "Failed to update property:" << slot_name; } } } static QPair takePair(const QVariant &value, const QPair defaultValue) { if (!value.isValid()) { return defaultValue; } const QStringList &l = value.toString().split(','); if (l.count() < 2) { return defaultValue; } QPair ret; ret.first = l.first().toDouble(); ret.second = l.at(1).toDouble(); return ret; } static QMarginsF takeMargins(const QVariant &value, const QMarginsF &defaultValue) { if (!value.isValid()) { return defaultValue; } const QStringList &l = value.toString().split(','); if (l.count() < 4) { return defaultValue; } return QMarginsF(l.at(0).toDouble(), l.at(1).toDouble(), l.at(2).toDouble(), l.at(3).toDouble()); } static inline QPointF toPos(const QPair &pair) { return QPointF(pair.first, pair.second); } QString DNoTitlebarWindowHelper::theme() const { return property("theme").toString(); } QPointF DNoTitlebarWindowHelper::windowRadius() const { return toPos(takePair(property("windowRadius"), qMakePair(0.0, 0.0))); } qreal DNoTitlebarWindowHelper::borderWidth() const { return property("borderWidth").toDouble(); } QColor DNoTitlebarWindowHelper::borderColor() const { return qvariant_cast(property("borderColor")); } qreal DNoTitlebarWindowHelper::shadowRadius() const { return property("shadowRadius").toDouble(); } QPointF DNoTitlebarWindowHelper::shadowOffset() const { return toPos(takePair(property("shadowOffset"), qMakePair(0.0, 0.0))); } QColor DNoTitlebarWindowHelper::shadowColor() const { return qvariant_cast(property("shadowColor")); } quint32 DNoTitlebarWindowHelper::windowEffect() { return qvariant_cast(property("windowEffect")); } quint32 DNoTitlebarWindowHelper::windowStartUpEffect() { return qvariant_cast(property("windowStartUpEffect")); } QMarginsF DNoTitlebarWindowHelper::mouseInputAreaMargins() const { return takeMargins(property("mouseInputAreaMargins"), QMarginsF(0, 0, 0, 0)); } void DNoTitlebarWindowHelper::resetProperty(const QByteArray &property) { int index = metaObject()->indexOfProperty(property.constData()); if (index >= 0) { metaObject()->property(index).reset(this); } } void DNoTitlebarWindowHelper::setTheme(const QString &theme) { setProperty("theme", theme); } void DNoTitlebarWindowHelper::setWindowRadius(const QPointF &windowRadius) { setProperty("windowRadius", QString("%1,%2").arg(windowRadius.x()).arg(windowRadius.y())); } void DNoTitlebarWindowHelper::setBorderWidth(qreal borderWidth) { setProperty("borderWidth", borderWidth); } void DNoTitlebarWindowHelper::setBorderColor(const QColor &borderColor) { setProperty("borderColor", QVariant::fromValue(borderColor)); } void DNoTitlebarWindowHelper::setShadowRadius(qreal shadowRadius) { setProperty("shadowRadius", shadowRadius); } void DNoTitlebarWindowHelper::setShadowOffect(const QPointF &shadowOffect) { setProperty("shadowOffset", QString("%1,%2").arg(shadowOffect.x()).arg(shadowOffect.y())); } void DNoTitlebarWindowHelper::setShadowColor(const QColor &shadowColor) { setProperty("shadowColor", QVariant::fromValue(shadowColor)); } void DNoTitlebarWindowHelper::setMouseInputAreaMargins(const QMarginsF &mouseInputAreaMargins) { setProperty("mouseInputAreaMargins", QString("%1,%2,%3,%4").arg(mouseInputAreaMargins.left()).arg(mouseInputAreaMargins.top()) .arg(mouseInputAreaMargins.right()).arg(mouseInputAreaMargins.bottom())); } void DNoTitlebarWindowHelper::setWindowEffect(quint32 effectScene) { setProperty("windowEffect", effectScene); } void DNoTitlebarWindowHelper::setWindowStartUpEffect(quint32 effectType) { setProperty("windowStartUpEffect", effectType); } DNoTitlebarWindowHelper *DNoTitlebarWindowHelper::windowHelper(const QWindow *window) { return mapped.value(window); } void DNoTitlebarWindowHelper::updateClipPathFromProperty() { const QVariant &v = m_window->property(clipPath); const QPainterPath &path = qvariant_cast(v); static xcb_atom_t _deepin_scissor_window = Utility::internAtom(_DEEPIN_SCISSOR_WINDOW, false); if (!path.isEmpty()) { m_clipPath = path * m_window->screen()->devicePixelRatio(); QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); ds << m_clipPath; Utility::setWindowProperty(m_windowID, _deepin_scissor_window, _deepin_scissor_window, data.constData(), data.length(), 8); } else { m_clipPath = QPainterPath(); Utility::clearWindowProperty(m_windowID, _deepin_scissor_window); } updateWindowShape(); } void DNoTitlebarWindowHelper::updateFrameMaskFromProperty() { // TODO } void DNoTitlebarWindowHelper::updateWindowRadiusFromProperty() { const QVariant &v = m_window->property("_d_windowRadius"); bool ok; int radius = v.toInt(&ok); if (ok) { setWindowRadius(QPointF(radius, radius) * m_window->screen()->devicePixelRatio()); } else { resetProperty("windowRadius"); } } void DNoTitlebarWindowHelper::updateBorderWidthFromProperty() { const QVariant &v = m_window->property("_d_borderWidth"); bool ok; int width = v.toInt(&ok); if (ok) { setBorderWidth(width); } else { resetProperty("borderWidth"); } } void DNoTitlebarWindowHelper::updateBorderColorFromProperty() { const QVariant &v = m_window->property("_d_borderColor"); const QColor &color = qvariant_cast(v); if (color.isValid()) { setBorderColor(color); } else { resetProperty("borderColor"); } } void DNoTitlebarWindowHelper::updateShadowRadiusFromProperty() { const QVariant &v = m_window->property("_d_shadowRadius"); bool ok; int radius = v.toInt(&ok); if (ok) { setShadowRadius(radius); } else { resetProperty("shadowRadius"); } } void DNoTitlebarWindowHelper::updateShadowOffsetFromProperty() { const QVariant &pos = m_window->property("_d_shadowOffset"); if (pos.isValid()) { setShadowOffect(pos.toPoint()); } else { resetProperty("shadowOffset"); } } void DNoTitlebarWindowHelper::updateShadowColorFromProperty() { const QVariant &v = m_window->property("_d_shadowColor"); const QColor &color = qvariant_cast(v); if (color.isValid()) { setShadowColor(color); } else { resetProperty("shadowColor"); } } void DNoTitlebarWindowHelper::updateWindowEffectFromProperty() { const QVariant &v = m_window->property("_d_windowEffect"); const quint32 effectScene = qvariant_cast(v); if (effectScene) { setWindowEffect(effectScene); } else { resetProperty("windowEffect"); } } void DNoTitlebarWindowHelper::updateWindowStartUpEffectFromProperty() { const QVariant &v = m_window->property("_d_windowStartUpEffect"); const quint32 effectType = qvariant_cast(v); if (effectType) { setWindowStartUpEffect(effectType); } else { resetProperty("windowStartUpEffect"); } } void DNoTitlebarWindowHelper::updateEnableSystemResizeFromProperty() { const QVariant &v = m_window->property(enableSystemResize); if (v.isValid() && !v.toBool()) { setMouseInputAreaMargins(QMarginsF(0, 0, 0, 0)); } else { resetProperty("mouseInputAreaMargins"); } } void DNoTitlebarWindowHelper::updateEnableSystemMoveFromProperty() { const QVariant &v = m_window->property(enableSystemMove); m_enableSystemMove = !v.isValid() || v.toBool(); if (m_enableSystemMove) { VtableHook::overrideVfptrFun(m_window, &QWindow::event, this, &DNoTitlebarWindowHelper::windowEvent); } else if (VtableHook::hasVtable(m_window)) { VtableHook::resetVfptrFun(m_window, &QWindow::event); } } void DNoTitlebarWindowHelper::updateEnableBlurWindowFromProperty() { const QVariant &v = m_window->property(enableBlurWindow); if (!v.isValid()) { m_window->setProperty(enableBlurWindow, m_enableBlurWindow); return; } if (m_enableBlurWindow != v.toBool()) { m_enableBlurWindow = v.toBool(); if (m_enableBlurWindow) { connect(DWMSupport::instance(), &DWMSupport::windowManagerChanged, this, &DNoTitlebarWindowHelper::updateWindowBlurAreasForWM); } else { disconnect(DWMSupport::instance(), &DWMSupport::windowManagerChanged, this, &DNoTitlebarWindowHelper::updateWindowBlurAreasForWM); } updateWindowBlurAreasForWM(); } } void DNoTitlebarWindowHelper::updateWindowBlurAreasFromProperty() { const QVariant &v = m_window->property(windowBlurAreas); const QVector &tmpV = qvariant_cast>(v); const int OffSet = 6; // Utility::BlurArea's member variables Q_ASSERT(tmpV.size() % OffSet == 0); QVector a; for (int i = 0; i < tmpV.size(); i += OffSet) { Utility::BlurArea area; area.x = tmpV[i + 0]; area.y = tmpV[i + 1]; area.width = tmpV[i + 2]; area.height = tmpV[i + 3]; area.xRadius = tmpV[i + 4]; area.yRaduis = tmpV[i + 5]; a << area; } if (a.isEmpty() && m_blurAreaList.isEmpty()) return; m_blurAreaList = a; updateWindowBlurAreasForWM(); } void DNoTitlebarWindowHelper::updateWindowBlurPathsFromProperty() { const QVariant &v = m_window->property(windowBlurPaths); const QList paths = qvariant_cast>(v); if (paths.isEmpty() && m_blurPathList.isEmpty()) return; m_blurPathList = paths; updateWindowBlurAreasForWM(); } void DNoTitlebarWindowHelper::updateAutoInputMaskByClipPathFromProperty() { bool auto_update_shape = m_window->property(autoInputMaskByClipPath).toBool(); if (auto_update_shape == m_autoInputMaskByClipPath) return; m_autoInputMaskByClipPath = auto_update_shape; updateWindowShape(); } bool DNoTitlebarWindowHelper::windowEvent(QEvent *event) { QWindow *w = this->window(); // TODO Crashed when delete by Vtable. if (event->type() == QEvent::DeferredDelete) { VtableHook::resetVtable(w); return w->event(event); } // get touch begin position static bool isTouchDown = false; static QPointF touchBeginPosition; if (event->type() == QEvent::TouchBegin) { isTouchDown = true; } if (event->type() == QEvent::TouchEnd || event->type() == QEvent::MouseButtonRelease) { isTouchDown = false; } if (isTouchDown && event->type() == QEvent::MouseButtonPress) { touchBeginPosition = static_cast(event)->globalPos(); } // add some redundancy to distinguish trigger between system menu and system move if (event->type() == QEvent::MouseMove) { QPointF currentPos = static_cast(event)->globalPos(); QPointF delta = touchBeginPosition - currentPos; if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { return VtableHook::callOriginalFun(w, &QWindow::event, event); } } DNoTitlebarWindowHelper *self = mapped.value(w); quint32 winId = self->m_windowID; bool is_mouse_move = event->type() == QEvent::MouseMove && static_cast(event)->buttons() == Qt::LeftButton; if (event->type() == QEvent::MouseButtonRelease) { self->m_windowMoving = false; Utility::updateMousePointForWindowMove(winId, true); g_pressPoint.remove(this); } if (is_mouse_move && self->m_windowMoving) { updateMoveWindow(winId); } bool ret = VtableHook::callOriginalFun(w, &QWindow::event, event); // workaround for kwin: Qt receives no release event when kwin finishes MOVE operation, // which makes app hang in windowMoving state. when a press happens, there's no sense of // keeping the moving state, we can just reset ti back to normal. if (event->type() == QEvent::MouseButtonPress) { self->m_windowMoving = false; g_pressPoint[this] = dynamic_cast(event)->globalPos(); } if (is_mouse_move && !event->isAccepted() && g_pressPoint.contains(this)) { QMouseEvent *me = static_cast(event); QRect windowRect = QRect(QPoint(0, 0), w->size()); if (!windowRect.contains(me->windowPos().toPoint())) { return ret; } QPointF delta = me->globalPos() - g_pressPoint[this]; if (delta.manhattanLength() < QGuiApplication::styleHints()->startDragDistance()) { return ret; } if (!self->m_windowMoving && self->isEnableSystemMove(winId)) { self->m_windowMoving = true; event->accept(); startMoveWindow(winId); if (qt_button_down) { qt_button_down = nullptr; } } } return ret; } bool DNoTitlebarWindowHelper::isEnableSystemMove(quint32 winId) { if (!m_enableSystemMove) return false; #ifdef Q_OS_LINUX quint32 hints = DXcbWMSupport::getMWMFunctions(Utility::getNativeTopLevelWindow(winId)); return ((hints & DXcbWMSupport::MWM_FUNC_ALL) || hints & DXcbWMSupport::MWM_FUNC_MOVE); #endif return true; } bool DNoTitlebarWindowHelper::updateWindowBlurAreasForWM() { bool blurEnable = m_enableBlurWindow || !m_blurAreaList.isEmpty() || !m_blurPathList.isEmpty(); // NOTE(zccrs): 当窗口unmap时清理模糊区域的属性,否则可能会导致窗口已经隐藏,但模糊区域没有消失的问题。因为窗口管理器不是绝对根据窗口是否map来绘制 // 模糊背景,当窗口unmap但是窗口的WM State值为Normal时也会绘制模糊背景(这种情况可能出现在连续多次快速切换窗口管理器时) if (!blurEnable || !DWMSupport::instance()->hasBlurWindow()) { Utility::clearWindowBlur(m_windowID); return true; } qreal device_pixel_ratio = m_window->screen()->devicePixelRatio(); quint32 top_level_w = Utility::getNativeTopLevelWindow(m_windowID); QPoint offset = QPoint(0, 0); const bool is_toplevel_window = (top_level_w == m_windowID); if (!is_toplevel_window) { offset += Utility::translateCoordinates(QPoint(0, 0), m_windowID, top_level_w); } QVector newAreas; if (m_enableBlurWindow) { m_needUpdateBlurAreaForWindowSizeChanged = !is_toplevel_window || !Utility::setEnableBlurWindow(m_windowID, true); if (m_needUpdateBlurAreaForWindowSizeChanged) { const QRect &windowValidRect = QRect(QPoint(0, 0), m_window->size() * device_pixel_ratio); Utility::BlurArea area; area.x = windowValidRect.x() + offset.x(); area.y = windowValidRect.y() + offset.y(); area.width = windowValidRect.width(); area.height = windowValidRect.height(); area.xRadius = 0; area.yRaduis = 0; newAreas.append(std::move(area)); return Utility::blurWindowBackground(top_level_w, newAreas); } else { return true; } } if (m_blurPathList.isEmpty()) { if (m_blurAreaList.isEmpty()) return true; newAreas.reserve(m_blurAreaList.size()); foreach (Utility::BlurArea area, m_blurAreaList) { area *= device_pixel_ratio; area.x += offset.x(); area.y += offset.y(); newAreas.append(std::move(area)); } if (newAreas.size() == m_blurAreaList.size()) return Utility::blurWindowBackground(top_level_w, newAreas); } QList newPathList; newPathList.reserve(m_blurAreaList.size()); foreach (Utility::BlurArea area, m_blurAreaList) { QPainterPath path; area *= device_pixel_ratio; path.addRoundedRect(area.x + offset.x(), area.y + offset.y(), area.width, area.height, area.xRadius, area.yRaduis); if (!path.isEmpty()) newPathList << path; } if (!m_blurPathList.isEmpty()) { newPathList.reserve(newPathList.size() + m_blurPathList.size()); foreach (const QPainterPath &path, m_blurPathList) { newPathList << (path * device_pixel_ratio).translated(offset); } } if (newPathList.isEmpty()) return true; return Utility::blurWindowBackgroundByPaths(top_level_w, newPathList); } void DNoTitlebarWindowHelper::updateWindowShape() { if (m_clipPath.isEmpty()) { return Utility::setShapePath(m_windowID, m_clipPath, false, false); } if (DWMSupport::instance()->hasScissorWindow()) { Utility::setShapePath(m_windowID, m_clipPath, true, m_autoInputMaskByClipPath); } else { Utility::setShapePath(m_windowID, m_clipPath, false, false); } } void DNoTitlebarWindowHelper::onWindowSizeChanged() { if (m_needUpdateBlurAreaForWindowSizeChanged) { updateWindowBlurAreasForWM(); } } void DNoTitlebarWindowHelper::startMoveWindow(quint32 winId) { Utility::startWindowSystemMove(winId); } void DNoTitlebarWindowHelper::updateMoveWindow(quint32 winId) { Utility::updateMousePointForWindowMove(winId); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dnotitlebarwindowhelper.h000066400000000000000000000116221476226662200234460ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DNOTITLEBARWINDOWHELPER_H #define DNOTITLEBARWINDOWHELPER_H #include "global.h" #include "utility.h" #include #include #include #include QT_BEGIN_NAMESPACE class QWindow; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DNativeSettings; class DNoTitlebarWindowHelper : public QObject { Q_OBJECT Q_PROPERTY(QString theme READ theme WRITE setTheme NOTIFY themeChanged) Q_PROPERTY(QPointF windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged) Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged) Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) Q_PROPERTY(qreal shadowRadius READ shadowRadius WRITE setShadowRadius NOTIFY shadowRadiusChanged) Q_PROPERTY(QPointF shadowOffset READ shadowOffset WRITE setShadowOffect NOTIFY shadowOffectChanged) Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor NOTIFY shadowColorChanged) Q_PROPERTY(quint32 windowEffect READ windowEffect WRITE setWindowEffect NOTIFY windowEffectChanged) Q_PROPERTY(quint32 windowStartUpEffect READ windowStartUpEffect WRITE setWindowStartUpEffect NOTIFY windowStartUpEffectChanged) Q_PROPERTY(QMarginsF mouseInputAreaMargins READ mouseInputAreaMargins WRITE setMouseInputAreaMargins NOTIFY mouseInputAreaMarginsChanged) public: explicit DNoTitlebarWindowHelper(QWindow *window, quint32 windowID); ~DNoTitlebarWindowHelper(); inline QWindow *window() const { return reinterpret_cast(const_cast(this));} static void setWindowProperty(QWindow *window, const char *name, const QVariant &value); QString theme() const; QPointF windowRadius() const; qreal borderWidth() const; QColor borderColor() const; qreal shadowRadius() const; QPointF shadowOffset() const; QColor shadowColor() const; quint32 windowEffect(); quint32 windowStartUpEffect(); QMarginsF mouseInputAreaMargins() const; void resetProperty(const QByteArray &property); void setTheme(const QString &theme); void setWindowRadius(const QPointF &windowRadius); void setBorderWidth(qreal borderWidth); void setBorderColor(const QColor &borderColor); void setShadowRadius(qreal shadowRadius); void setShadowOffect(const QPointF &shadowOffset); void setShadowColor(const QColor &shadowColor); void setMouseInputAreaMargins(const QMarginsF &mouseInputAreaMargins); void setWindowEffect(quint32 effectScene); void setWindowStartUpEffect(quint32 effectType); static DNoTitlebarWindowHelper *windowHelper(const QWindow *window); signals: void themeChanged(); void windowRadiusChanged(); void borderWidthChanged(); void borderColorChanged(); void shadowRadiusChanged(); void shadowOffectChanged(); void shadowColorChanged(); void windowEffectChanged(); void windowStartUpEffectChanged(); void mouseInputAreaMarginsChanged(); private slots: // update properties Q_SLOT void updateClipPathFromProperty(); Q_SLOT void updateFrameMaskFromProperty(); Q_SLOT void updateWindowRadiusFromProperty(); Q_SLOT void updateBorderWidthFromProperty(); Q_SLOT void updateBorderColorFromProperty(); Q_SLOT void updateShadowRadiusFromProperty(); Q_SLOT void updateShadowOffsetFromProperty(); Q_SLOT void updateShadowColorFromProperty(); Q_SLOT void updateWindowEffectFromProperty(); Q_SLOT void updateWindowStartUpEffectFromProperty(); Q_SLOT void updateEnableSystemResizeFromProperty(); Q_SLOT void updateEnableSystemMoveFromProperty(); Q_SLOT void updateEnableBlurWindowFromProperty(); Q_SLOT void updateWindowBlurAreasFromProperty(); Q_SLOT void updateWindowBlurPathsFromProperty(); Q_SLOT void updateAutoInputMaskByClipPathFromProperty(); private: bool windowEvent(QEvent *event); bool isEnableSystemMove(quint32 winId); bool updateWindowBlurAreasForWM(); void updateWindowShape(); void onWindowSizeChanged(); static void startMoveWindow(quint32 winId); static void updateMoveWindow(quint32 winId); QWindow *m_window; quint32 m_windowID; bool m_windowMoving = false; bool m_nativeSettingsValid = false; QVector m_blurAreaList; QList m_blurPathList; bool m_needUpdateBlurAreaForWindowSizeChanged = false; QPainterPath m_clipPath; // properties bool m_enableSystemMove = true; bool m_enableBlurWindow = false; bool m_autoInputMaskByClipPath = false; DNativeSettings *m_settings; static QHash mapped; friend class DPlatformIntegration; }; DPP_END_NAMESPACE Q_DECLARE_METATYPE(QMarginsF) #endif // DNOTITLEBARWINDOWHELPER_H qt5platform-plugins-5.7.12/xcb/dplatformbackingstore.cpp000066400000000000000000001471611476226662200234360ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dplatformbackingstore.h" #include "dplatformwindowhook.h" #include "vtablehook.h" #ifdef Q_OS_LINUX #include "dxcbwmsupport.h" #endif #include "qxcbbackingstore.h" #include #include #include #include #include #include #include #include #include #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include #else #include #endif #ifndef QT_NO_OPENGL #include #include #include #include #include #include #if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) #include #else #include #endif #include #include #endif #include #include #include DPP_BEGIN_NAMESPACE PUBLIC_CLASS(QMouseEvent, WindowEventListener); PUBLIC_CLASS(QWheelEvent, WindowEventListener); PUBLIC_CLASS(QResizeEvent, WindowEventListener); PUBLIC_CLASS(QWidget, WindowEventListener); PUBLIC_CLASS(QWindow, WindowEventListener); PUBLIC_CLASS(QXcbWindow, DPlatformBackingStore); class WindowEventListener : public QObject { Q_OBJECT public: explicit WindowEventListener(DPlatformBackingStore *store) : QObject(0) , m_store(store) { cursorAnimation.setDuration(50); cursorAnimation.setEasingCurve(QEasingCurve::InExpo); connect(&cursorAnimation, &QVariantAnimation::valueChanged, this, &WindowEventListener::onAnimationValueChanged); startAnimationTimer.setSingleShot(true); startAnimationTimer.setInterval(300); connect(&startAnimationTimer, &QTimer::timeout, this, &WindowEventListener::startAnimation); } ~WindowEventListener() { const QWidgetWindow *widgetWindow = m_store->widgetWindow(); QWidget *widget = widgetWindow->widget(); if (widget) { VtableHook::clearGhostVtable(widget); } else { VtableHook::clearGhostVtable(m_store->window()); } } public slots: void updateWindowBlurAreasForWM() { m_store->updateWindowBlurAreasForWM(); } protected: bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE { QWindow *window = qobject_cast(obj); if (!window) return false; const QRect &window_geometry = window->geometry(); // qDebug() << obj << event->type() << window_geometry; switch ((int)event->type()) { case QEvent::Wheel: { DQWheelEvent *e = static_cast(event); if (!window_geometry.contains(e->globalPos())) return true; e->p -= m_store->windowOffset() / window->devicePixelRatio(); break; } case QEvent::MouseMove: case QEvent::MouseButtonDblClick: case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: { DQMouseEvent *e = static_cast(event); if (Q_LIKELY(e->source() != Qt::MouseEventSynthesizedByQt)) { e->l -= m_store->windowOffset() / window->devicePixelRatio(); e->w -= m_store->windowOffset() / window->devicePixelRatio(); } if (window->flags().testFlag(Qt::Popup) || window->flags().testFlag(Qt::BypassWindowManagerHint)) break; const QRect &window_visible_rect = QRect(m_store->windowValidRect.topLeft() + window_geometry.topLeft(), m_store->windowValidRect.size() / window->devicePixelRatio()); if (window->minimumSize() == window->maximumSize() || !m_store->m_enableSystemResize) goto skip_set_cursor; if (!leftButtonPressed && (!window_visible_rect.contains(e->globalPos()) || !m_store->m_clipPath.contains(e->windowPos() * window->devicePixelRatio()))) { if (event->type() == QEvent::MouseMove) { bool isFixedWidth = window->minimumWidth() == window->maximumWidth(); bool isFixedHeight = window->minimumHeight() == window->maximumHeight(); Utility::CornerEdge mouseCorner; QRect cornerRect; const QRect window_real_geometry = window_visible_rect + QMargins(MOUSE_MARGINS, MOUSE_MARGINS, MOUSE_MARGINS, MOUSE_MARGINS); if (isFixedWidth || isFixedHeight) goto set_edge; /// begin set cursor corner type cornerRect.setSize(QSize(MOUSE_MARGINS * 2, MOUSE_MARGINS * 2)); cornerRect.moveTopLeft(window_real_geometry.topLeft()); if (cornerRect.contains(e->globalPos())) { mouseCorner = Utility::TopLeftCorner; goto set_cursor; } cornerRect.moveTopRight(window_real_geometry.topRight()); if (cornerRect.contains(e->globalPos())) { mouseCorner = Utility::TopRightCorner; goto set_cursor; } cornerRect.moveBottomRight(window_real_geometry.bottomRight()); if (cornerRect.contains(e->globalPos())) { mouseCorner = Utility::BottomRightCorner; goto set_cursor; } cornerRect.moveBottomLeft(window_real_geometry.bottomLeft()); if (cornerRect.contains(e->globalPos())) { mouseCorner = Utility::BottomLeftCorner; goto set_cursor; } set_edge: /// begin set cursor edge type if (e->globalX() <= window_visible_rect.x()) { if (isFixedWidth) goto skip_set_cursor; mouseCorner = Utility::LeftEdge; } else if (e->globalX() < window_visible_rect.right()) { if (isFixedHeight) goto skip_set_cursor; if (e->globalY() <= window_visible_rect.y()) { mouseCorner = Utility::TopEdge; } else if (!isFixedWidth || e->globalY() >= window_visible_rect.bottom()) { mouseCorner = Utility::BottomEdge; } else { goto skip_set_cursor; } } else if (!isFixedWidth && (!isFixedHeight || e->globalX() >= window_visible_rect.right())) { mouseCorner = Utility::RightEdge; } else { goto skip_set_cursor; } set_cursor: Utility::setWindowCursor(window->winId(), mouseCorner); if (qApp->mouseButtons() == Qt::LeftButton) { Utility::startWindowSystemResize(window->winId(), mouseCorner); cancelAdsorbCursor(); } else { adsorbCursor(mouseCorner); } } else if (event->type() == QEvent::MouseButtonRelease) { Utility::cancelWindowMoveResize(window->winId()); } return true; } skip_set_cursor: if (e->buttons() == Qt::LeftButton) { if (e->type() == QEvent::MouseButtonPress) setLeftButtonPressed(true); else if (e->type() == QEvent::MouseButtonRelease) setLeftButtonPressed(false); } else { setLeftButtonPressed(false); } qApp->setOverrideCursor(window->cursor()); cancelAdsorbCursor(); canAdsorbCursor = m_store->m_enableSystemResize; break; } case QEvent::Resize: { const QSize &old_size = window->property("_dxcb_window_old_size").toSize(); const QSize &new_size = window->handle()->geometry().size(); if (old_size == new_size) return true; window->setProperty("_dxcb_window_old_size", new_size); DQResizeEvent *e = static_cast(event); e->s = window->size(); break; } case QEvent::Enter: canAdsorbCursor = m_store->m_enableSystemResize; break; case QEvent::Leave: canAdsorbCursor = false; cancelAdsorbCursor(); break; case QEvent::DynamicPropertyChange: { QDynamicPropertyChangeEvent *e = static_cast(event); if (e->propertyName() == netWmStates) { m_store->onWindowStateChanged(); } else if (e->propertyName() == windowRadius) { m_store->updateWindowRadius(); } else if (e->propertyName() == borderWidth) { m_store->updateBorderWidth(); } else if (e->propertyName() == borderColor) { m_store->updateBorderColor(); } else if (e->propertyName() == shadowRadius) { m_store->updateShadowRadius(); } else if (e->propertyName() == shadowOffset) { m_store->updateShadowOffset(); } else if (e->propertyName() == shadowColor) { m_store->updateShadowColor(); } else if (e->propertyName() == clipPath) { m_store->updateUserClipPath(); } else if (e->propertyName() == frameMask) { m_store->updateFrameMask(); } else if (e->propertyName() == translucentBackground) { m_store->updateTranslucentBackground(); } else if (e->propertyName() == enableSystemResize) { m_store->updateEnableSystemResize(); if (!m_store->m_enableSystemMove) { qApp->setOverrideCursor(window->cursor()); cancelAdsorbCursor(); canAdsorbCursor = false; Utility::cancelWindowMoveResize(window->winId()); } } else if (e->propertyName() == enableSystemMove) { m_store->updateEnableSystemMove(); if (!m_store->m_enableSystemMove) Utility::cancelWindowMoveResize(window->winId()); updateStealMoveEvent(); } else if (e->propertyName() == enableBlurWindow) { m_store->updateEnableBlurWindow(); } else if (e->propertyName() == windowBlurAreas) { m_store->updateWindowBlurAreas(); } else if (e->propertyName() == windowBlurPaths) { m_store->updateWindowBlurPaths(); } else if (e->propertyName() == autoInputMaskByClipPath) { m_store->updateAutoInputMaskByClipPath(); } break; } default: break; } return false; } void mouseMoveEvent(QMouseEvent *event) { Q_UNUSED(event); ///TODO: Warning: System move finished no mouse release event Utility::startWindowSystemMove(reinterpret_cast(this)->winId()); } void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE { if (event->timerId() == m_store->updateShadowTimer.timerId()) { m_store->repaintWindowShadow(); } } private: void setLeftButtonPressed(bool pressed) { if (leftButtonPressed == pressed) return; if (!pressed) Utility::cancelWindowMoveResize(m_store->window()->winId()); leftButtonPressed = pressed; updateStealMoveEvent(); } void updateStealMoveEvent() { const QWidgetWindow *widgetWindow = m_store->widgetWindow(); QWidget *widget = widgetWindow->widget(); if (widget) { if (leftButtonPressed && m_store->m_enableSystemMove) { VtableHook::overrideVfptrFun(static_cast(widget), &DQWidget::mouseMoveEvent, this, &WindowEventListener::mouseMoveEvent); } else { VtableHook::resetVfptrFun(static_cast(widget), &DQWidget::mouseMoveEvent); } } else { QWindow *window = m_store->window(); if (leftButtonPressed && m_store->m_enableSystemMove) { VtableHook::overrideVfptrFun(static_cast(window), &DQWindow::mouseMoveEvent, this, &WindowEventListener::mouseMoveEvent); } else { VtableHook::resetVfptrFun(static_cast(window), &DQWindow::mouseMoveEvent); } } } void adsorbCursor(Utility::CornerEdge cornerEdge) { lastCornerEdge = cornerEdge; if (!canAdsorbCursor) return; if (cursorAnimation.state() == QVariantAnimation::Running) return; startAnimationTimer.start(); } void cancelAdsorbCursor() { QSignalBlocker blocker(&startAnimationTimer); Q_UNUSED(blocker) startAnimationTimer.stop(); cursorAnimation.stop(); } void onAnimationValueChanged(const QVariant &value) { QCursor::setPos(value.toPoint()); } void startAnimation() { QPoint cursorPos = QCursor::pos(); QPoint toPos = cursorPos; const QRect geometry = QRect(m_store->windowValidRect.topLeft() + m_store->window()->position(), m_store->windowValidRect.size() / m_store->window()->devicePixelRatio()).adjusted(-1, -1, 1, 1); switch (lastCornerEdge) { case Utility::TopLeftCorner: toPos = geometry.topLeft(); break; case Utility::TopEdge: toPos.setY(geometry.y()); break; case Utility::TopRightCorner: toPos = geometry.topRight(); break; case Utility::RightEdge: toPos.setX(geometry.right()); break; case Utility::BottomRightCorner: toPos = geometry.bottomRight(); break; case Utility::BottomEdge: toPos.setY(geometry.bottom()); break; case Utility::BottomLeftCorner: toPos = geometry.bottomLeft(); break; case Utility::LeftEdge: toPos.setX(geometry.x()); break; default: break; } const QPoint &tmp = toPos - cursorPos; if (qAbs(tmp.x()) < 3 && qAbs(tmp.y()) < 3) return; canAdsorbCursor = false; cursorAnimation.setStartValue(cursorPos); cursorAnimation.setEndValue(toPos); cursorAnimation.start(); } /// mouse left button is pressed in window valid geometry bool leftButtonPressed = false; bool canAdsorbCursor = false; Utility::CornerEdge lastCornerEdge; QTimer startAnimationTimer; QVariantAnimation cursorAnimation; DPlatformBackingStore *m_store; }; //class DXcbShmGraphicsBuffer : public QPlatformGraphicsBuffer //{ //public: // DXcbShmGraphicsBuffer(QImage *image) // : QPlatformGraphicsBuffer(image->size(), QImage::toPixelFormat(image->format())) // , m_access_lock(QPlatformGraphicsBuffer::None) // , m_image(image) // { } // bool doLock(AccessTypes access, const QRect &rect) Q_DECL_OVERRIDE // { // Q_UNUSED(rect); // if (access & ~(QPlatformGraphicsBuffer::SWReadAccess | QPlatformGraphicsBuffer::SWWriteAccess)) // return false; // m_access_lock |= access; // return true; // } // void doUnlock() Q_DECL_OVERRIDE { m_access_lock = None; } // const uchar *data() const Q_DECL_OVERRIDE { return m_image.bits(); } // uchar *data() Q_DECL_OVERRIDE { return m_image.bits(); } // int bytesPerLine() const Q_DECL_OVERRIDE { return m_image.bytesPerLine(); } // Origin origin() const Q_DECL_OVERRIDE { return QPlatformGraphicsBuffer::OriginTopLeft; } //private: // AccessTypes m_access_lock; // QImage *m_image; //}; DPlatformBackingStore::DPlatformBackingStore(QWindow *window, QXcbBackingStore *proxy) : QPlatformBackingStore(window) , m_proxy(proxy), #ifndef QT_NO_OPENGL m_textureId(0), m_blitter(0) #endif { m_eventListener = new WindowEventListener(this); m_windowHook = DPlatformWindowHook::getHookByWindow(window->handle()); shadowPixmap.fill(Qt::transparent); #ifdef Q_OS_LINUX m_enableShadow = DXcbWMSupport::instance()->hasWindowAlpha(); QObject::connect(DXcbWMSupport::instance(), &DXcbWMSupport::hasCompositeChanged, m_eventListener, [this, window] (bool hasComposite) { m_enableShadow = hasComposite; updateWindowMargins(); updateClipPath(); doDelayedUpdateWindowShadow(); }); #endif initUserProperties(); //! Warning: At this point you must be initialized window Margins and window Extents updateWindowMargins(); // updateFrameExtents(); VtableHook::overrideVfptrFun(static_cast(window->handle()), &QXcbWindowEventListener::handlePropertyNotifyEvent, this, &DPlatformBackingStore::handlePropertyNotifyEvent); QObject::connect(window, &QWindow::windowStateChanged, m_eventListener, [this] { updateWindowMargins(false); }); window->installEventFilter(m_eventListener); } DPlatformBackingStore::~DPlatformBackingStore() { delete m_proxy; delete m_eventListener; // if (m_graphicsBuffer) // delete m_graphicsBuffer; VtableHook::clearGhostVtable(static_cast(static_cast(window()->handle()))); } QPaintDevice *DPlatformBackingStore::paintDevice() { return &m_image; } static QColor colorBlend(const QColor &color1, const QColor &color2) { QColor c2 = color2.toRgb(); if (c2.alpha() >= 255) return c2; QColor c1 = color1.toRgb(); qreal c1_weight = 1 - c2.alphaF(); int r = c1_weight * c1.red() + c2.alphaF() * c2.red(); int g = c1_weight * c1.green() + c2.alphaF() * c2.green(); int b = c1_weight * c1.blue() + c2.alphaF() * c2.blue(); return QColor(r, g, b); } void DPlatformBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { Q_UNUSED(region) if (!m_proxy->paintDevice()) return; const QPoint &windowOffset = this->windowOffset(); QRegion tmp_region; QPainter pa(m_proxy->paintDevice()); pa.setCompositionMode(QPainter::CompositionMode_Source); #ifdef Q_OS_LINUX if (DXcbWMSupport::instance()->hasWindowAlpha()) #endif pa.setRenderHint(QPainter::Antialiasing); if (m_enableShadow) { pa.setClipPath(m_windowClipPath); for (const QRect &rect : region.rects()) { const QRect &tmp_rect = rect.translated(windowOffset); pa.drawImage(tmp_rect, m_image, rect); if (tmp_rect.size() == m_size) { tmp_region += QRect(QPoint(0, 0), m_size); } else { tmp_region += tmp_rect.united(QRect(windowOffset, m_image.size())); } } } else { pa.setPen(m_borderColor); QColor border_color = m_borderColor; #ifdef Q_OS_LINUX if (!DXcbWMSupport::instance()->hasWindowAlpha()) border_color = colorBlend(QColor("#e0e0e0"), m_borderColor); #endif tmp_region += QRect(QPoint(0, 0), m_size); if (m_borderWidth > 0) { QPainterPath path; path.addRect(tmp_region.rects().first()); path -= m_windowClipPath; pa.fillPath(path, border_color); pa.setClipPath(m_windowClipPath); } pa.drawImage(windowOffset, m_image); } pa.end(); // qDebug() << "flush" << window << tmp_region << offset; DPlatformWindowHook *window_hook = m_windowHook; if (window_hook) window_hook->setWindowMargins(QMargins(0, 0, 0, 0)); m_proxy->flush(window, tmp_region, offset); if (window_hook) window_hook->setWindowMargins(windowMargins); } #ifndef QT_NO_OPENGL static inline QRect deviceRect(const QRect &rect, QWindow *window) { QRect deviceRect(rect.topLeft() * window->devicePixelRatio(), rect.size() * window->devicePixelRatio()); return deviceRect; } static QRegion deviceRegion(const QRegion ®ion, QWindow *window, const QPoint &offset) { if (offset.isNull() && window->devicePixelRatio() <= 1) return region; QVector rects; const QVector regionRects = region.rects(); rects.reserve(regionRects.count()); foreach (const QRect &rect, regionRects) rects.append(deviceRect(rect.translated(offset), window)); QRegion deviceRegion; deviceRegion.setRects(rects.constData(), rects.count()); return deviceRegion; } static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight) { return QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1, topLeftRect.width(), topLeftRect.height()); } static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect, QOpenGLTextureBlitter *blitter, const QPoint &offset) { Q_UNUSED(deviceWindowRect) //original clipRect is wrong because of frame margins //const QRect clipRect = textures->clipRect(idx); QRect rectInWindow = textures->geometry(idx); const QRect clipRect = QRect(QPoint(), rectInWindow.size()); if (clipRect.isEmpty()) return; // relative to the TLW, not necessarily our window (if the flush is for a native child widget), have to adjust rectInWindow.translate(-offset); const QRect clippedRectInWindow = rectInWindow & clipRect.translated(rectInWindow.topLeft()); const QRect srcRect = toBottomLeftRect(clipRect, rectInWindow.height()); const QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform( deviceRect(clippedRectInWindow, window), clippedRectInWindow); //deviceWindowRect); const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(deviceRect(srcRect, window), deviceRect(rectInWindow, window).size(), QOpenGLTextureBlitter::OriginBottomLeft); blitter->blit(textures->textureId(idx), target, source); } #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) void DPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context) { Q_UNUSED(textures); Q_UNUSED(context); flush(window, region, offset); } #else void DPlatformBackingStore::composeAndFlushHelper(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) { Q_UNUSED(region) //if (!qt_window_private(window)->receivedExpose) //return; if (!context->makeCurrent(window)) { qWarning("composeAndFlush: makeCurrent() failed"); return; } //QWindowPrivate::get(window)->lastComposeTime.start(); QPoint reversedOrigin(windowMargins.left(), windowMargins.bottom()); // reversed QOpenGLFunctions *funcs = context->functions(); funcs->glViewport(reversedOrigin.x(), reversedOrigin.y(), m_windowSize.width() * window->devicePixelRatio(), m_windowSize.height() * window->devicePixelRatio()); funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1); funcs->glClear(GL_COLOR_BUFFER_BIT); if (!m_blitter) { m_blitter = new QOpenGLTextureBlitter; m_blitter->create(); } m_blitter->bind(); const QRect deviceWindowRect = deviceRect(QRect(windowOffset(), m_windowSize), window); // Textures for renderToTexture widgets. for (int i = 0; i < textures->count(); ++i) { if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) blitTextureForWidget(textures, i, window, deviceWindowRect, m_blitter, offset); } // Backingstore texture with the normal widgets. GLuint textureId = 0; QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft; #if 0 if (QPlatformGraphicsBuffer *graphicsBuffer = this->graphicsBuffer()) { if (graphicsBuffer->size() != m_textureSize) { if (m_textureId) funcs->glDeleteTextures(1, &m_textureId); funcs->glGenTextures(1, &m_textureId); funcs->glBindTexture(GL_TEXTURE_2D, m_textureId); QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx->isOpenGLES() || ctx->format().majorVersion() >= 3) { funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); } funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); funcs->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); if (QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &m_needsSwizzle, &m_premultiplied)) { m_textureSize = graphicsBuffer->size(); } else { m_textureSize = QSize(0,0); } graphicsBuffer->unlock(); } else if (!region.isEmpty()){ funcs->glBindTexture(GL_TEXTURE_2D, m_textureId); QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &m_needsSwizzle, &m_premultiplied); } if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft) origin = QOpenGLTextureBlitter::OriginBottomLeft; textureId = m_textureId; } else #endif { TextureFlags flags = 0; //I don't know why region is empty //textureId = toTexture(deviceRegion(region, window, offset + windowOffset()), &m_textureSize, &flags); QRegion region(0, 0, m_windowSize.width(), m_windowSize.height()); #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) textureId = toTexture(deviceRegion(region, window, offset), &m_textureSize, false); #else textureId = toTexture(deviceRegion(region, window, offset), &m_textureSize, &flags); #endif m_needsSwizzle = (flags & TextureSwizzle) != 0; m_premultiplied = (flags & TexturePremultiplied) != 0; if (flags & TextureFlip) origin = QOpenGLTextureBlitter::OriginBottomLeft; } funcs->glEnable(GL_BLEND); if (m_premultiplied) funcs->glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); else funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); if (textureId) { if (m_needsSwizzle) #if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) m_blitter->setSwizzleRB(true); #else m_blitter->setRedBlueSwizzle(true); #endif // The backingstore is for the entire tlw. // In case of native children offset tells the position relative to the tlw. // reverse translate backward for widgets const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(offset-windowOffset()), m_textureSize.height()); const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(srcRect, m_textureSize, origin); m_blitter->blit(textureId, QMatrix4x4(), source); if (m_needsSwizzle) #if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) m_blitter->setSwizzleRB(false); #else m_blitter->setRedBlueSwizzle(false); #endif } // Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set. for (int i = 0; i < textures->count(); ++i) { if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)) blitTextureForWidget(textures, i, window, deviceWindowRect, m_blitter, offset); } funcs->glDisable(GL_BLEND); m_blitter->release(); context->swapBuffers(window); } void DPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) { if (textures != nullptr) { composeAndFlushHelper(window, region, offset, textures, context, translucentBackground); } } #endif QImage DPlatformBackingStore::toImage() const { return m_image; } #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) GLuint DPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textureSize) const { return m_proxy->toTexture(dirtyRegion, textureSize); } #elif QT_VERSION < QT_VERSION_CHECK(5, 5, 0) GLuint DPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textureSize, bool *needsSwizzle) const { return QPlatformBackingStore::toTexture(dirtyRegion, textureSize, needsSwizzle); } #else GLuint DPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const { return QPlatformBackingStore::toTexture(dirtyRegion, textureSize, flags); } #endif #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) QPlatformGraphicsBuffer *DPlatformBackingStore::graphicsBuffer() const { // return m_graphicsBuffer; return m_proxy->graphicsBuffer(); } #endif void DPlatformBackingStore::resize(const QSize &size, const QRegion &staticContents) { // qDebug() << "resize" << size << staticContents; #if QT_VERSION > QT_VERSION_CHECK(5, 5, 1) if (size == m_image.size()) return; m_image = QImage(size, QImage::Format_ARGB32_Premultiplied); #else const int dpr = int(window()->devicePixelRatio()); const QSize xSize = size * dpr; if (xSize == m_image.size() && dpr == m_image.devicePixelRatio()) return; m_image = QImage(xSize, QImage::Format_ARGB32_Premultiplied); m_image.setDevicePixelRatio(dpr); #endif // if (m_graphicsBuffer) // delete m_graphicsBuffer; // m_graphicsBuffer = new DXcbShmGraphicsBuffer(&m_image); m_windowSize = size; m_size = QSize(size.width() + windowMargins.left() + windowMargins.right(), size.height() + windowMargins.top() + windowMargins.bottom()); m_proxy->resize(m_size, staticContents); updateClipPath(); //! TODO: update window margins // updateWindowMargins(); if (isUserSetClipPath) { if (shadowPixmap.isNull()) { updateWindowShadow(); } if (!m_windowClipPath.isEmpty()) updateWindowBlurAreasForWM(); } else { updateWindowShadow(); if (!m_blurAreaList.isEmpty() || !m_blurPathList.isEmpty() || m_enableBlurWindow) updateWindowBlurAreasForWM(); } updateInputShapeRegion(); paintWindowShadow(); } void DPlatformBackingStore::beginPaint(const QRegion ®ion) { if (m_translucentBackground) { QPainter p(paintDevice()); p.setCompositionMode(QPainter::CompositionMode_Source); const QVector rects = region.rects(); const QColor blank = Qt::transparent; for (QVector::const_iterator it = rects.begin(); it != rects.end(); ++it) { const QRect &rect = *it; p.fillRect(rect, blank); } } } void DPlatformBackingStore::endPaint() { // m_proxy->endPaint(); // qDebug() << "end paint"; } void DPlatformBackingStore::initUserProperties() { updateWindowRadius(); updateBorderWidth(); updateBorderColor(); updateUserClipPath(); updateFrameMask(); updateShadowRadius(); updateShadowOffset(); updateShadowColor(); updateTranslucentBackground(); updateEnableSystemMove(); updateEnableSystemResize(); updateEnableBlurWindow(); updateWindowBlurAreas(); updateWindowBlurPaths(); updateAutoInputMaskByClipPath(); } bool DPlatformBackingStore::updateWindowMargins(bool repaintShadow) { Qt::WindowState state = window()->windowState(); const QMargins old_margins = windowMargins; const QRect &window_geometry = window()->handle()->geometry(); if (state == Qt::WindowMaximized || state == Qt::WindowFullScreen) { setWindowMargins(QMargins(0, 0, 0, 0)); } else if (state != Qt::WindowMinimized) { setWindowMargins(QMargins(qMax(getShadowRadius() - getShadowOffset().x(), m_borderWidth), qMax(getShadowRadius() - getShadowOffset().y(), m_borderWidth), qMax(getShadowRadius() + getShadowOffset().x(), m_borderWidth), qMax(getShadowRadius() + getShadowOffset().y(), m_borderWidth))); } if (repaintShadow && old_margins != windowMargins) { window()->handle()->setGeometry(window_geometry); repaintWindowShadow(); return true; } return false; } void DPlatformBackingStore::updateFrameExtents() { QMargins extentsMargins = windowMargins; if (canUseClipPath() && !isUserSetClipPath) { extentsMargins -= m_borderWidth; } Utility::setFrameExtents(window()->winId(), extentsMargins); } void DPlatformBackingStore::updateInputShapeRegion() { if (!windowGeometry().isValid()) return; int mouse_margins; if (m_enableShadow) mouse_margins = canResize() ? MOUSE_MARGINS : 0; else mouse_margins = m_borderWidth; // clear old state Utility::setShapeRectangles(window()->winId(), QRegion(), true); Utility::setShapeRectangles(window()->winId(), QRegion(), false); if (m_autoInputMaskByClipPath && (isUserSetClipPath || getWindowRadius() > 0)) { QPainterPath p; if (Q_LIKELY(mouse_margins > 0)) { QPainterPathStroker stroker; stroker.setJoinStyle(Qt::MiterJoin); stroker.setWidth(mouse_margins * 2); p = stroker.createStroke(m_windowClipPath); p = p.united(m_windowClipPath); p.translate(-0.5, -0.5); } else { p = m_windowClipPath; } Utility::setShapePath(window()->winId(), p #ifdef Q_OS_LINUX , DXcbWMSupport::instance()->hasWindowAlpha() #endif ); } else { QRegion region(windowGeometry().adjusted(-mouse_margins, -mouse_margins, mouse_margins, mouse_margins)); Utility::setShapeRectangles(window()->winId(), region #ifdef Q_OS_LINUX , DXcbWMSupport::instance()->hasWindowAlpha() #endif ); } } void DPlatformBackingStore::updateWindowRadius() { const QVariant &v = window()->property(windowRadius); if (!v.isValid()) { window()->setProperty(windowRadius, m_windowRadius); return; } bool ok; int radius = v.toInt(&ok); if (ok && radius != m_windowRadius) { m_windowRadius = radius; isUserSetWindowRadius = true; updateClipPath(); } } void DPlatformBackingStore::updateBorderWidth() { const QVariant &v = window()->property(borderWidth); if (!v.isValid()) { window()->setProperty(borderWidth, m_borderWidth); return; } bool ok; int width = v.toInt(&ok); if (ok && width != m_borderWidth) { m_borderWidth = width; updateFrameExtents(); if (!updateWindowMargins()) doDelayedUpdateWindowShadow(); } } void DPlatformBackingStore::updateBorderColor() { const QVariant &v = window()->property(borderColor); if (!v.isValid()) { window()->setProperty(borderColor, m_borderColor); return; } const QColor &color = qvariant_cast(v); if (color.isValid() && m_borderColor != color) { m_borderColor = color; doDelayedUpdateWindowShadow(); } } void DPlatformBackingStore::updateUserClipPath() { const QVariant &v = window()->property(clipPath); if (!v.isValid()) { return; } QPainterPath path; path = qvariant_cast(v); if (!isUserSetClipPath && path.isEmpty()) return; isUserSetClipPath = !path.isEmpty(); if (path.isEmpty()) updateClipPath(); else setClipPah(path * window()->devicePixelRatio()); } void DPlatformBackingStore::updateClipPath() { if (!isUserSetClipPath) { QPainterPath path; if (canUseClipPath()) path.addRoundedRect(QRect(QPoint(0, 0), m_windowSize), getWindowRadius(), getWindowRadius()); else path.addRect(0, 0, m_windowSize.width(), m_windowSize.height()); setClipPah(path); } } void DPlatformBackingStore::updateFrameMask() { const QVariant &v = window()->property(frameMask); if (!v.isValid()) { return; } QRegion region = qvariant_cast(v); static_cast(window()->handle())->QXcbWindow::setMask(region * window()->devicePixelRatio()); isUserSetFrameMask = !region.isEmpty(); } void DPlatformBackingStore::updateShadowRadius() { const QVariant &v = window()->property(shadowRadius); if (!v.isValid()) { window()->setProperty(shadowRadius, m_shadowRadius); return; } bool ok; int radius = qMax(v.toInt(&ok), 0); if (ok && radius != m_shadowRadius) { m_shadowRadius = radius; updateWindowMargins(); if (m_enableShadow) doDelayedUpdateWindowShadow(); } } void DPlatformBackingStore::updateShadowOffset() { const QVariant &v = window()->property(shadowOffset); if (!v.isValid()) { window()->setProperty(shadowOffset, m_shadowOffset); return; } const QPoint &offset = v.toPoint(); if (offset != m_shadowOffset) { m_shadowOffset = offset; updateWindowMargins(); if (m_enableShadow) doDelayedUpdateWindowShadow(); } } void DPlatformBackingStore::updateShadowColor() { const QVariant &v = window()->property(shadowColor); if (!v.isValid()) { window()->setProperty(shadowColor, m_shadowColor); return; } const QColor &color = qvariant_cast(v); if (color.isValid() && m_shadowColor != color) { m_shadowColor = color; if (m_enableShadow) doDelayedUpdateWindowShadow(); } } void DPlatformBackingStore::updateTranslucentBackground() { const QVariant &v = window()->property(translucentBackground); if (!v.isValid()) { window()->setProperty(translucentBackground, m_translucentBackground); return; } m_translucentBackground = v.toBool(); } void DPlatformBackingStore::updateEnableSystemResize() { const QVariant &v = window()->property(enableSystemResize); if (!v.isValid()) { window()->setProperty(enableSystemResize, m_enableSystemResize); return; } if (m_enableSystemResize == v.toBool()) return; m_enableSystemResize = v.toBool(); updateInputShapeRegion(); } void DPlatformBackingStore::updateEnableSystemMove() { const QVariant &v = window()->property(enableSystemMove); if (!v.isValid()) { window()->setProperty(enableSystemMove, m_enableSystemMove); return; } m_enableSystemMove = v.toBool(); } void DPlatformBackingStore::updateEnableBlurWindow() { const QVariant &v = window()->property(enableBlurWindow); if (!v.isValid()) { window()->setProperty(enableBlurWindow, m_enableBlurWindow); return; } if (m_enableBlurWindow != v.toBool()) { m_enableBlurWindow = v.toBool(); #ifdef Q_OS_LINUX if (m_enableBlurWindow) { QObject::connect(DXcbWMSupport::instance(), &DXcbWMSupport::windowManagerChanged, m_eventListener, &WindowEventListener::updateWindowBlurAreasForWM); } else { QObject::disconnect(DXcbWMSupport::instance(), &DXcbWMSupport::windowManagerChanged, m_eventListener, &WindowEventListener::updateWindowBlurAreasForWM); } #endif updateWindowBlurAreasForWM(); } } void DPlatformBackingStore::updateWindowBlurAreas() { const QVariant &v = window()->property(windowBlurAreas); const QVector &tmpV = qvariant_cast>(v); const QVector &a = *(reinterpret_cast*>(&tmpV)); if (a.isEmpty() && m_blurAreaList.isEmpty()) return; m_blurAreaList = a; updateWindowBlurAreasForWM(); } void DPlatformBackingStore::updateWindowBlurPaths() { const QVariant &v = window()->property(windowBlurPaths); const QList paths = qvariant_cast>(v); if (paths.isEmpty() && m_blurPathList.isEmpty()) return; m_blurPathList = paths; updateWindowBlurAreasForWM(); } void DPlatformBackingStore::updateAutoInputMaskByClipPath() { const QVariant &v = window()->property(autoInputMaskByClipPath); if (!v.isValid()) { window()->setProperty(autoInputMaskByClipPath, m_autoInputMaskByClipPath); return; } if (m_autoInputMaskByClipPath != v.toBool()) { m_autoInputMaskByClipPath = v.toBool(); } } void DPlatformBackingStore::setWindowMargins(const QMargins &margins) { if (windowMargins == margins) return; windowMargins = margins; m_windowClipPath = m_clipPath.translated(windowOffset()); DPlatformWindowHook *hook = m_windowHook; if (hook) { hook->setWindowMargins(margins, true); } const QSize &tmp_size = windowGeometry().size(); m_size = QSize(tmp_size.width() + windowMargins.left() + windowMargins.right(), tmp_size.height() + windowMargins.top() + windowMargins.bottom()); if (m_size.isValid()) { m_proxy->resize(m_size, QRegion()); } updateInputShapeRegion(); updateFrameExtents(); if (!m_blurAreaList.isEmpty() || !m_blurPathList.isEmpty() || m_enableBlurWindow) updateWindowBlurAreasForWM(); window()->setProperty(frameMargins, QVariant::fromValue(windowMargins)); } void DPlatformBackingStore::setClipPah(const QPainterPath &path) { if (m_clipPath != path) { m_clipPath = path; m_windowClipPath = m_clipPath.translated(windowOffset()); windowValidRect = m_clipPath.boundingRect().toRect(); updateInputShapeRegion(); if (isUserSetClipPath) { updateWindowBlurAreasForWM(); doDelayedUpdateWindowShadow(); } } } void DPlatformBackingStore::paintWindowShadow(QRegion region) { if (!m_proxy->paintDevice() || shadowPixmap.isNull()) return; QPainter pa; /// begin paint window drop shadow pa.begin(m_proxy->paintDevice()); pa.setCompositionMode(QPainter::CompositionMode_Source); pa.drawPixmap(0, 0, shadowPixmap); pa.end(); DPlatformWindowHook *window_hook = m_windowHook; if (window_hook) window_hook->setWindowMargins(QMargins(0, 0, 0, 0)); if (region.isEmpty()) { region += QRect(windowMargins.left(), 0, m_windowSize.width(), windowMargins.top()); region += QRect(windowMargins.left(), windowMargins.top() + m_windowSize.height(), m_windowSize.width(), windowMargins.bottom()); region += QRect(0, 0, windowMargins.left(), m_size.height()); region += QRect(windowMargins.left() + m_windowSize.width(), 0, windowMargins.right(), m_size.height()); } m_proxy->flush(window(), region, QPoint(0, 0)); if (window_hook) window_hook->setWindowMargins(windowMargins); /// end } void DPlatformBackingStore::repaintWindowShadow() { updateShadowTimer.stop(); shadowPixmap = QPixmap(); if (windowMargins.isNull()) return; updateWindowShadow(); paintWindowShadow(QRegion(0, 0, m_size.width(), m_size.height())); if (!shadowPixmap.isNull()) flush(window(), QRect(QPoint(0, 0), m_windowSize), QPoint(0, 0)); } inline QSize margins2Size(const QMargins &margins) { return QSize(margins.left() + margins.right(), margins.top() + margins.bottom()); } void DPlatformBackingStore::updateWindowShadow() { if (m_image.isNull() || !m_enableShadow) return; bool paintShadow = isUserSetClipPath || shadowPixmap.isNull(); if (!paintShadow) { QSize margins_size = margins2Size(windowMargins + getWindowRadius() + m_borderWidth); if (margins_size.width() > qMin(m_size.width(), shadowPixmap.width()) || margins_size.height() > qMin(m_size.height(), shadowPixmap.height())) { paintShadow = true; } } if (paintShadow) { int shadow_radius = qMax(getShadowRadius(), m_borderWidth); QImage image; if (shadow_radius > m_borderWidth) { QPixmap pixmap(m_size - QSize(2 * shadow_radius, 2 * shadow_radius)); if (pixmap.isNull()) return; pixmap.fill(Qt::transparent); QPainter pa(&pixmap); pa.fillPath(m_clipPath, m_shadowColor); pa.end(); image = Utility::dropShadow(pixmap, shadow_radius, m_shadowColor); } else { image = QImage(m_size, QImage::Format_ARGB32_Premultiplied); image.fill(Qt::transparent); } /// begin paint window border; QPainter pa; pa.begin(&image); if (m_borderWidth > 0) { QPainterPathStroker pathStroker; pathStroker.setWidth(m_borderWidth * 2); QTransform transform = pa.transform(); const QRectF &clipRect = m_clipPath.boundingRect(); transform.translate(windowMargins.left() + 2, windowMargins.top() + 2); transform.scale((clipRect.width() - 4) / clipRect.width(), (clipRect.height() - 4) / clipRect.height()); pa.setRenderHint(QPainter::Antialiasing); pa.fillPath(pathStroker.createStroke(m_windowClipPath), m_borderColor); pa.setCompositionMode(QPainter::CompositionMode_Clear); pa.setRenderHint(QPainter::Antialiasing, false); pa.setTransform(transform); } pa.fillPath(m_clipPath, Qt::transparent); pa.end(); /// end shadowPixmap = QPixmap::fromImage(image); } else { shadowPixmap = QPixmap::fromImage(Utility::borderImage(shadowPixmap, windowMargins + getWindowRadius(), m_size)); } } bool DPlatformBackingStore::updateWindowBlurAreasForWM() { const QRect &windowValidRect = windowGeometry(); if (windowValidRect.isEmpty()) return false; xcb_window_t top_level_w = Utility::getNativeTopLevelWindow(window()->winId()); QPoint offset; if (top_level_w != window()->winId()) { offset = Utility::translateCoordinates(QPoint(0, 0), window()->winId(), top_level_w); } QVector newAreas; qreal device_pixel_ratio = window()->devicePixelRatio(); if (m_enableBlurWindow) { Utility::BlurArea area; area.x = windowValidRect.x() << offset.x(); area.y = windowValidRect.y() << offset.y(); area.width = windowValidRect.width(); area.height = windowValidRect.height(); area.xRadius = getWindowRadius(); area.yRaduis = getWindowRadius(); newAreas.append(std::move(area)); } else { newAreas.reserve(m_blurAreaList.size()); foreach (Utility::BlurArea area, m_blurAreaList) { area *= device_pixel_ratio; if (area.x < 0) { area.width += area.x; area.x = 0; } if (area.y < 0) { area.height += area.y; area.y = 0; } area.x += windowValidRect.x(); area.y += windowValidRect.y(); area.width = qMin(area.x + area.width, windowValidRect.right() + 1) - area.x; area.height = qMin(area.y + area.height, windowValidRect.bottom() + 1) - area.y; area.x += offset.x(); area.y += offset.y(); newAreas.append(std::move(area)); } } if ((isUserSetClipPath && !m_windowClipPath.isEmpty()) || !m_blurPathList.isEmpty()) { QList newPathList; newPathList.reserve(m_blurPathList.size()); foreach (QPainterPath path, m_blurPathList) { path *= device_pixel_ratio; if (m_windowClipPath.isEmpty()) newPathList << path.translated(windowValidRect.topLeft() + offset); else newPathList << path.translated(windowValidRect.topLeft()).intersected(m_windowClipPath).translated(offset); } foreach (const Utility::BlurArea &area, newAreas) { QPainterPath path; path.addRoundedRect(area.x, area.y, area.width, area.height, area.xRadius, area.yRaduis); if (m_windowClipPath.isEmpty()) newPathList << path; else newPathList << path.intersected(m_windowClipPath.translated(offset)); } return Utility::blurWindowBackgroundByPaths(top_level_w, newPathList); } return Utility::blurWindowBackground(top_level_w, newAreas); } void DPlatformBackingStore::doDelayedUpdateWindowShadow(int delaye) { if (m_eventListener) updateShadowTimer.start(delaye, m_eventListener); } bool DPlatformBackingStore::isWidgetWindow(const QWindow *window) { return window->metaObject()->className() == QStringLiteral("QWidgetWindow"); } QWidgetWindow *DPlatformBackingStore::widgetWindow() const { return static_cast(window()); } int DPlatformBackingStore::getWindowRadius() const { #ifdef Q_OS_LINUX return (isUserSetWindowRadius || DXcbWMSupport::instance()->hasWindowAlpha()) ? m_windowRadius : 0; #else return m_windowRadius; #endif } bool DPlatformBackingStore::canUseClipPath() const { QXcbWindow::NetWmStates states = (QXcbWindow::NetWmStates)window()->property(netWmStates).toInt(); if (states & (QXcbWindow::NetWmStateFullScreen | QXcbWindow::NetWmStateMaximizedHorz | QXcbWindow::NetWmStateMaximizedVert)) { return false; } return true; } bool DPlatformBackingStore::canResize() const { return m_enableSystemResize && !window()->flags().testFlag(Qt::Popup) && window()->minimumSize() != window()->maximumSize(); } void DPlatformBackingStore::onWindowStateChanged() { updateClipPath(); updateFrameExtents(); doDelayedUpdateWindowShadow(); } void DPlatformBackingStore::handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) { DQXcbWindow *window = static_cast(reinterpret_cast(this)); QWindow *ww = window->window(); Qt::WindowState oldState = ww->windowState(); window->QXcbWindow::handlePropertyNotifyEvent(event); if (window->m_windowState != oldState) { ww->setWindowState(window->m_windowState); } if (event->window == window->xcb_window() && event->atom == window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_STATE))) { QXcbWindow::NetWmStates states = window->netWmStates(); ww->setProperty(netWmStates, (int)states); } } DPP_END_NAMESPACE #include "dplatformbackingstore.moc" qt5platform-plugins-5.7.12/xcb/dplatformbackingstore.h000066400000000000000000000133521476226662200230750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DXCBBACKINGSTORE_H #define DXCBBACKINGSTORE_H #define private public #include #undef private #include #include #include "global.h" #include "utility.h" QT_BEGIN_NAMESPACE class QXcbBackingStore; class QWidgetWindow; class QOpenGLTextureBlitter; QT_END_NAMESPACE struct xcb_property_notify_event_t; DPP_BEGIN_NAMESPACE class DXcbShmGraphicsBuffer; class WindowEventListener; class DPlatformWindowHook; class DPlatformBackingStore : public QPlatformBackingStore { public: DPlatformBackingStore(QWindow *window, QXcbBackingStore *proxy); ~DPlatformBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; // 'window' can be a child window, in which case 'region' is in child window coordinates and // offset is the (child) window's offset in relation to the window surface. void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context) Q_DECL_OVERRIDE; #else void composeAndFlushHelper(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground); void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; #endif QImage toImage() const Q_DECL_OVERRIDE; #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize) const Q_DECL_OVERRIDE; #elif QT_VERSION < QT_VERSION_CHECK(5, 5, 0) GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, bool *needsSwizzle) const Q_DECL_OVERRIDE; #else GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const Q_DECL_OVERRIDE; #endif #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; #endif void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; void beginPaint(const QRegion ®ion) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; static bool isWidgetWindow(const QWindow *window); private: void initUserProperties(); bool updateWindowMargins(bool repaintShadow = true); void updateFrameExtents(); void updateInputShapeRegion(); void updateClipPath(); void updateWindowShadow(); bool updateWindowBlurAreasForWM(); void doDelayedUpdateWindowShadow(int delaye = 30); /// update of user properties void updateWindowRadius(); void updateBorderWidth(); void updateBorderColor(); void updateUserClipPath(); void updateFrameMask(); void updateShadowRadius(); void updateShadowOffset(); void updateShadowColor(); void updateTranslucentBackground(); void updateEnableSystemResize(); void updateEnableSystemMove(); void updateEnableBlurWindow(); void updateWindowBlurAreas(); void updateWindowBlurPaths(); void updateAutoInputMaskByClipPath(); void setWindowMargins(const QMargins &margins); void setClipPah(const QPainterPath &path); void setWindowBlurArea(const QVector &area); void paintWindowShadow(QRegion region = QRegion()); void repaintWindowShadow(); inline bool isWidgetWindow() const { return isWidgetWindow(window());} QWidgetWindow *widgetWindow() const; inline QPoint windowOffset() const { return QPoint(windowMargins.left(), windowMargins.top());} inline QRect windowGeometry() const { return QRect(windowOffset(), m_windowSize);} inline int getShadowRadius() const { return m_enableShadow ? m_shadowRadius : 0;} inline QPoint getShadowOffset() const { return m_shadowOffset;} inline int getWindowRadius() const; bool canUseClipPath() const; bool canResize() const; void onWindowStateChanged(); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event); QSize m_size; QSize m_windowSize; QImage m_image; QXcbBackingStore *m_proxy; WindowEventListener *m_eventListener = Q_NULLPTR; // DXcbShmGraphicsBuffer *m_graphicsBuffer = Q_NULLPTR; DPlatformWindowHook *m_windowHook = Q_NULLPTR; int m_windowRadius = 4; bool isUserSetWindowRadius = false; int m_borderWidth = 1; bool isUserSetClipPath = false; QPainterPath m_clipPath; QPainterPath m_windowClipPath; QColor m_borderColor = QColor(0, 0, 0, 255 * 0.15); int m_shadowRadius = 60; QPoint m_shadowOffset = QPoint(0, 16); QColor m_shadowColor = QColor(0, 0, 0, 255 * 0.6); QPixmap shadowPixmap; bool m_translucentBackground = false; bool m_enableSystemResize = true; bool m_enableSystemMove = true; bool m_enableBlurWindow = false; bool m_autoInputMaskByClipPath = true; bool m_enableShadow = true; QVector m_blurAreaList; QList m_blurPathList; QRect windowValidRect; QMargins windowMargins; bool isUserSetFrameMask = false; QBasicTimer updateShadowTimer; friend class WindowEventListener; #ifndef QT_NO_OPENGL GLuint m_textureId; QSize m_textureSize; bool m_needsSwizzle; bool m_premultiplied; QOpenGLTextureBlitter *m_blitter; #endif }; DPP_END_NAMESPACE Q_DECLARE_METATYPE(QMargins) #endif // DXCBBACKINGSTORE_H qt5platform-plugins-5.7.12/xcb/dplatformbackingstorehelper.cpp000066400000000000000000000157331476226662200246350ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dplatformbackingstorehelper.h" #include "vtablehook.h" #include "dplatformwindowhelper.h" #include "dframewindow.h" #include "dwmsupport.h" #ifdef Q_OS_LINUX #define private public #include "qxcbbackingstore.h" #undef private #endif #include #include #include #include #include #include #ifdef Q_OS_LINUX QT_BEGIN_NAMESPACE class QXcbShmImage : public QXcbObject { public: xcb_shm_segment_info_t m_shm_info; }; QT_END_NAMESPACE #endif DPP_BEGIN_NAMESPACE DPlatformBackingStoreHelper::DPlatformBackingStoreHelper() { } bool DPlatformBackingStoreHelper::addBackingStore(QPlatformBackingStore *store) { VtableHook::overrideVfptrFun(store, &QPlatformBackingStore::beginPaint, this, &DPlatformBackingStoreHelper::beginPaint); VtableHook::overrideVfptrFun(store, &QPlatformBackingStore::paintDevice, this, &DPlatformBackingStoreHelper::paintDevice); VtableHook::overrideVfptrFun(store, &QPlatformBackingStore::resize, this, &DPlatformBackingStoreHelper::resize); return VtableHook::overrideVfptrFun(store, &QPlatformBackingStore::flush, this, &DPlatformBackingStoreHelper::flush); } static QThreadStorage _d_dxcb_overridePaintDevice; QPaintDevice *DPlatformBackingStoreHelper::paintDevice() { QPlatformBackingStore *store = backingStore(); if (_d_dxcb_overridePaintDevice.hasLocalData() && _d_dxcb_overridePaintDevice.localData()) { static thread_local QImage device(1, 1, QImage::Format_Alpha8); return &device; } return VtableHook::callOriginalFun(store, &QPlatformBackingStore::paintDevice); } void DPlatformBackingStoreHelper::beginPaint(const QRegion ®ion) { QPlatformBackingStore *store = backingStore(); bool has_alpha = store->window()->property("_d_dxcb_TransparentBackground").toBool(); if (!has_alpha) _d_dxcb_overridePaintDevice.setLocalData(true); VtableHook::callOriginalFun(store, &QPlatformBackingStore::beginPaint, region); _d_dxcb_overridePaintDevice.setLocalData(false); } void DPlatformBackingStoreHelper::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { if (!backingStore()->paintDevice()) return; if (Q_LIKELY(DWMSupport::instance()->hasWindowAlpha())) { DPlatformWindowHelper *window_helper = DPlatformWindowHelper::mapped.value(window->handle()); if (!window_helper) goto end; qreal device_pixel_ratio = window_helper->m_nativeWindow->window()->devicePixelRatio(); int window_radius = qRound(window_helper->getWindowRadius() * device_pixel_ratio); // 停止触发内部窗口更新的定时器 if (window_helper->m_frameWindow->m_paintShadowOnContentTimerId > 0) { window_helper->m_frameWindow->killTimer(window_helper->m_frameWindow->m_paintShadowOnContentTimerId); window_helper->m_frameWindow->m_paintShadowOnContentTimerId = -1; } if (window_helper && (window_helper->m_isUserSetClipPath || window_radius > 0)) { QPainterPath path; QPainterPath clip_path = window_helper->m_clipPath * device_pixel_ratio; QRegion new_region = region; // if (!window_helper->m_isUserSetClipPath) { // QRect window_rect(QPoint(0, 0), window_helper->m_nativeWindow->geometry().size()); // new_region += QRect(0, 0, window_radius, window_radius); // new_region += QRect(window_rect.width() - window_radius, // window_rect.height() - window_radius, // window_radius, window_radius); // new_region += QRect(0, window_rect.height() - window_radius, // window_radius, window_radius); // new_region += QRect(window_rect.width() - window_radius, 0, // window_radius, window_radius); // } path.addRegion(new_region); path -= clip_path; if (path.isEmpty()) goto end; QPainter pa(backingStore()->paintDevice()); if (!pa.isActive()) goto end; QBrush border_brush(window_helper->m_frameWindow->m_shadowImage); const QPoint &offset = (window_helper->m_frameWindow->m_contentGeometry.topLeft() - 2 * window_helper->m_frameWindow->contentOffsetHint()) * device_pixel_ratio; border_brush.setTransform(QTransform(1, 0, 0, 1, offset.x(), offset.y())); pa.setRenderHint(QPainter::Antialiasing); pa.setCompositionMode(QPainter::CompositionMode_Source); pa.fillPath(path, border_brush); if (window_helper->getBorderWidth() > 0 && window_helper->m_borderColor != Qt::transparent) { pa.setClipPath(path); pa.setPen(QPen(window_helper->m_borderColor, window_helper->getBorderWidth(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); pa.drawPath(clip_path); } pa.end(); } } end: return VtableHook::callOriginalFun(this->backingStore(), &QPlatformBackingStore::flush, window, region, offset); } #ifdef Q_OS_LINUX void DPlatformBackingStoreHelper::resize(const QSize &size, const QRegion &staticContents) { VtableHook::callOriginalFun(this->backingStore(), &QPlatformBackingStore::resize, size, staticContents); QXcbBackingStore *bs = static_cast(backingStore()); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) QXcbShmImage *shm_image = reinterpret_cast(bs->m_image); #else struct _QXcbBackingStore { QImage *m_image; }; // Expose m_image QXcbShmImage *shm_image = reinterpret_cast(reinterpret_cast<_QXcbBackingStore*>( &bs )->m_image); #endif if (shm_image->m_shm_info.shmaddr) { DPlatformWindowHelper *window_helper = DPlatformWindowHelper::mapped.value(bs->window()->handle()); if (!window_helper) return; xcb_atom_t atom = Utility::internAtom("_DEEPIN_DXCB_SHM_INFO", false); QVector info; const QImage &qimage = bs->toImage(); info << shm_image->m_shm_info.shmid // 共享内存 id << qimage.width() // 图片宽度 << qimage.height() // 图片高度 << qimage.bytesPerLine() // 同QImage::bytesPerLine << qimage.format() // 图片格式 << 0 // 图片有效区域的x << 0 // 图片有效区域的y << qimage.width() // 图片有效区域的宽度 << qimage.height(); // 图片有效区域的高度 Utility::setWindowProperty(window_helper->m_frameWindow->winId(), atom, XCB_ATOM_CARDINAL, info.constData(), info.length(), sizeof(quint32) * 8); } } #endif DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformbackingstorehelper.h000066400000000000000000000017551476226662200243010ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPLATFORMBACKINGSTOREHELPER_H #define DPLATFORMBACKINGSTOREHELPER_H #include #include "global.h" QT_BEGIN_NAMESPACE class QPlatformBackingStore; class QWindow; class QRegion; class QPoint; class QPaintDevice; class QSize; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DPlatformBackingStoreHelper { public: DPlatformBackingStoreHelper(); bool addBackingStore(QPlatformBackingStore *store); QPlatformBackingStore *backingStore() const { return reinterpret_cast(const_cast(this));} QPaintDevice *paintDevice(); void beginPaint(const QRegion &); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifdef Q_OS_LINUX void resize(const QSize &size, const QRegion &staticContents); #endif }; DPP_END_NAMESPACE #endif // DPLATFORMBACKINGSTOREHELPER_H qt5platform-plugins-5.7.12/xcb/dplatforminputcontexthook.cpp000066400000000000000000000021701476226662200243760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "dplatforminputcontexthook.h" #include "global.h" #include DPP_BEGIN_NAMESPACE void DPlatformInputContextHook::showInputPanel(QPlatformInputContext *inputContext) { Q_UNUSED(inputContext) instance()->setImActive(true); } void DPlatformInputContextHook::hideInputPanel(QPlatformInputContext *inputContext) { Q_UNUSED(inputContext) instance()->setImActive(false); } bool DPlatformInputContextHook::isInputPanelVisible(QPlatformInputContext *inputContext) { Q_UNUSED(inputContext) return instance()->imActive(); } QRectF DPlatformInputContextHook::keyboardRect(QPlatformInputContext *inputContext) { Q_UNUSED(inputContext) return instance()->geometry(); } Q_GLOBAL_STATIC_WITH_ARGS(ComDeepinImInterface, __imInterface, (QString("com.deepin.im"), QString("/com/deepin/im"), QDBusConnection::sessionBus())) ComDeepinImInterface* DPlatformInputContextHook::instance() { return __imInterface; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatforminputcontexthook.h000066400000000000000000000014471476226662200240510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2020 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef DPLATFORMINPUTCONTEXTHOOK_H #define DPLATFORMINPUTCONTEXTHOOK_H #include "global.h" #include #include #include "im_interface.h" QT_BEGIN_NAMESPACE class QPlatformInputContext; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DPlatformInputContextHook { public: static void showInputPanel(QPlatformInputContext *inputContext); static void hideInputPanel(QPlatformInputContext *inputContext); static bool isInputPanelVisible(QPlatformInputContext *inputContext); static QRectF keyboardRect(QPlatformInputContext *inputContext); static ComDeepinImInterface* instance(); }; DPP_END_NAMESPACE #endif // DPLATFORMINPUTCONTEXTHOOK_H qt5platform-plugins-5.7.12/xcb/dplatformintegration.cpp000066400000000000000000001320311476226662200232740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #define private public #include #undef private #include "dplatformintegration.h" #include "global.h" #include "dforeignplatformwindow.h" #include "vtablehook.h" #include "dwmsupport.h" #include "dnotitlebarwindowhelper.h" #include "dnativesettings.h" #include "dbackingstoreproxy.h" #include "ddesktopinputselectioncontrol.h" #include "dapplicationeventmonitor.h" #ifdef USE_NEW_IMPLEMENTING #include "dplatformwindowhelper.h" #include "dplatformbackingstorehelper.h" #include "dplatformopenglcontexthelper.h" #include "dframewindow.h" #else #include "dplatformbackingstore.h" #include "dplatformwindowhook.h" #endif #ifdef Q_OS_LINUX #define private public #include "qxcbcursor.h" #include "qxcbdrag.h" #undef private #include "windoweventhook.h" #include "xcbnativeeventfilter.h" #include "dplatformnativeinterfacehook.h" #include "dplatforminputcontexthook.h" #include "dxcbxsettings.h" #include "dhighdpi.h" #include "qxcbscreen.h" #include #include #include #endif #include #include #include #include #include #include #define protected public #include #undef protected #include #include #include #include #include "im_interface.h" #include "dbus_interface.h" // https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/ #define XSETTINGS_CURSOR_BLINK QByteArrayLiteral("Net/CursorBlink") #define XSETTINGS_CURSOR_BLINK_TIME QByteArrayLiteral("Net/CursorBlinkTime") #define XSETTINGS_DOUBLE_CLICK_TIME QByteArrayLiteral("Net/DoubleClickTime") Q_LOGGING_CATEGORY(lcDxcb, "dtk.qpa.dxcb", QtInfoMsg) class DQPaintEngine : public QPaintEngine { public: inline void clearFeatures(const QPaintEngine::PaintEngineFeatures &f) { gccaps &= ~f; } }; DPP_BEGIN_NAMESPACE #ifdef Q_OS_LINUX #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) DPlatformIntegration *DPlatformIntegration::m_instance = Q_NULLPTR; #endif #endif DXcbXSettings *DPlatformIntegration::m_xsettings = nullptr; DPlatformIntegration::DPlatformIntegration(const QStringList ¶meters, int &argc, char **argv) : DPlatformIntegrationParent(parameters, argc, argv) #ifdef USE_NEW_IMPLEMENTING , m_storeHelper(new DPlatformBackingStoreHelper) , m_contextHelper(new DPlatformOpenGLContextHelper) , m_pApplicationEventMonitor(nullptr) #endif { #ifdef Q_OS_LINUX #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) m_instance = this; #endif #endif VtableHook::overrideVfptrFun(nativeInterface(), &QPlatformNativeInterface::platformFunction, &DPlatformNativeInterfaceHook::platformFunction); // 不仅仅需要在插件被加载时初始化, 也有可能DPlatformIntegration会被创建多次, 也应当在 // DPlatformIntegration每次被创建时都重新初始化DHighDpi. DHighDpi::init(); } DPlatformIntegration::~DPlatformIntegration() { sendEndStartupNotifition(); #ifdef Q_OS_LINUX if (m_eventFilter) { qApp->removeNativeEventFilter(m_eventFilter); delete m_eventFilter; } #endif #ifdef USE_NEW_IMPLEMENTING delete m_storeHelper; delete m_contextHelper; if (m_xsettings) { delete m_xsettings; m_xsettings = nullptr; } #endif } void DPlatformIntegration::setWindowProperty(QWindow *window, const char *name, const QVariant &value) { if (isEnableNoTitlebar(window)) { DNoTitlebarWindowHelper::setWindowProperty(window, name, value); } else if (isEnableDxcb(window)) { DPlatformWindowHelper::setWindowProperty(window, name, value); } } bool DPlatformIntegration::enableDxcb(QWindow *window) { qCDebug(lcDxcb) << "window:" << window << "window type:" << window->type() << "parent:" << window->parent(); if (window->type() == Qt::Desktop) return false; QNativeWindow *xw = static_cast(window->handle()); if (!xw) { window->setProperty(useDxcb, true); return true; } #ifndef USE_NEW_IMPLEMENTING return false; #endif if (DPlatformWindowHelper::mapped.value(xw)) return true; if (xw->isExposed()) return false; if (!DPlatformWindowHelper::windowRedirectContent(window)) { QPlatformBackingStore *store = reinterpret_cast(qvariant_cast(window->property("_d_dxcb_BackingStore"))); if (!store) return false; QSurfaceFormat format = window->format(); const int oldAlpha = format.alphaBufferSize(); const int newAlpha = 8; if (oldAlpha != newAlpha) { format.setAlphaBufferSize(newAlpha); window->setFormat(format); // 由于窗口alpha值的改变,需要重新创建x widnow xw->create(); } DPlatformWindowHelper *helper = new DPlatformWindowHelper(xw); instance()->m_storeHelper->addBackingStore(store); helper->m_frameWindow->m_contentBackingStore = store; } else { Q_UNUSED(new DPlatformWindowHelper(xw)) } window->setProperty(useDxcb, true); window->setProperty("_d_dxcb_TransparentBackground", window->format().hasAlpha()); return true; } bool DPlatformIntegration::isEnableDxcb(const QWindow *window) { return window->property(useDxcb).toBool(); } bool DPlatformIntegration::setEnableNoTitlebar(QWindow *window, bool enable) { if (enable && DNoTitlebarWindowHelper::mapped.value(window)) return true; qCDebug(lcDxcb) << "enable titlebar:" << enable << "window:" << window << "window type:" << window->type() << "parent:" << window->parent(); if (enable) { if (window->type() == Qt::Desktop) return false; if (!DWMSupport::instance()->hasNoTitlebar()) return false; QNativeWindow *xw = static_cast(window->handle()); window->setProperty(noTitlebar, true); if (!xw) { return true; } Utility::setNoTitlebar(xw->winId(), true); // 跟随窗口被销毁 Q_UNUSED(new DNoTitlebarWindowHelper(window, xw->winId())) } else { if (auto helper = DNoTitlebarWindowHelper::mapped.value(window)) { Utility::setNoTitlebar(window->winId(), false); helper->deleteLater(); } window->setProperty(noTitlebar, QVariant()); } return true; } bool DPlatformIntegration::isEnableNoTitlebar(const QWindow *window) { return window->property(noTitlebar).toBool(); } bool DPlatformIntegration::buildNativeSettings(QObject *object, quint32 settingWindow) { QByteArray settings_property = DNativeSettings::getSettingsProperty(object); DXcbXSettings *settings = nullptr; bool global_settings = false; if (settingWindow || !settings_property.isEmpty()) { settings = new DXcbXSettings(DPlatformIntegration::xcbConnection()->xcb_connection(), settingWindow, settings_property); } else { global_settings = true; settings = DPlatformIntegration::instance()->xSettings(); } // 跟随object销毁 auto native_settings = new DNativeSettings(object, settings, global_settings); if (!native_settings->isValid()) { delete native_settings; return false; } return true; } void DPlatformIntegration::clearNativeSettings(quint32 settingWindow) { #ifdef Q_OS_LINUX DXcbXSettings::clearSettings(settingWindow); #endif } void DPlatformIntegration::setWMClassName(const QByteArray &name) { if (auto self = instance()) self->m_wmClass = name; } #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) static void nativeWindowCreated(QNativeWindow *w) { VtableHook::callOriginalFun(w, &QNativeWindow::create); if (w->property("_d_dxcb_noTitleHelper").toBool()) { if (w->property("_d_dxcb_noTitleHelper_destroyed").toBool()) { w->setProperty("_d_dxcb_noTitleHelper_destroyed", QVariant()); qCDebug(lcDxcb) << "window is recreated:" << w->window() << ", winId:" << w->winId(); if (auto helper = DNoTitlebarWindowHelper::windowHelper(w->window())) { delete helper; } // 跟随窗口被销毁 Q_UNUSED(new DNoTitlebarWindowHelper(w->window(), w->winId())) } } } static void nativeWindowDestroyed(QNativeWindow *w) { VtableHook::callOriginalFun(w, &QNativeWindow::destroy); if (w->property("_d_dxcb_noTitleHelper").toBool()) { w->setProperty("_d_dxcb_noTitleHelper_destroyed", true); } } #endif QPlatformWindow *DPlatformIntegration::createPlatformWindow(QWindow *window) const { qCDebug(lcDxcb) << "window:" << window << "window type:" << window->type() << "parent:" << window->parent(); if (qEnvironmentVariableIsSet("DXCB_PRINT_WINDOW_CREATE")) { printf("New Window: %s(0x%llx, name: \"%s\")\n", window->metaObject()->className(), (quintptr)window, qPrintable(window->objectName())); } #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // handle foreign native window if (window->type() == Qt::ForeignWindow) { WId win_id = qvariant_cast(window->property("_q_foreignWinId")); if (win_id > 0) { return new DForeignPlatformWindow(window, win_id); } } #endif bool isNoTitlebar = window->type() != Qt::Desktop && window->property(noTitlebar).toBool(); if (isNoTitlebar && DWMSupport::instance()->hasNoTitlebar()) { // 销毁旧的helper对象, 此处不用将mapped的值移除,后面会被覆盖 if (DNoTitlebarWindowHelper *helper = DNoTitlebarWindowHelper::mapped.value(window)) { delete helper; } QPlatformWindow *w = DPlatformIntegrationParent::createPlatformWindow(window); Utility::setNoTitlebar(w->winId(), true); // 跟随窗口被销毁 Q_UNUSED(new DNoTitlebarWindowHelper(window, w->winId())) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // recreate DNotitleBarWindoHelper if window is recreated. QNativeWindow *xw = static_cast(w); xw->setProperty("_d_dxcb_noTitleHelper", true); VtableHook::overrideVfptrFun(xw, &QNativeWindow::create, &nativeWindowCreated); VtableHook::overrideVfptrFun(xw, &QNativeWindow::destroy, &nativeWindowDestroyed); #endif #ifdef Q_OS_LINUX WindowEventHook::init(static_cast(w), false); #endif // for hi dpi if (DHighDpi::overrideBackingStore()) { bool ok = VtableHook::overrideVfptrFun(w, &QPlatformWindow::devicePixelRatio, &DHighDpi::devicePixelRatio); if (ok) { window->setProperty("_d_dxcb_overrideBackingStore", true); } } return w; } bool isUseDxcb = window->type() != Qt::Desktop && window->property(useDxcb).toBool(); if (isUseDxcb) { QSurfaceFormat format = window->format(); const int oldAlpha = format.alphaBufferSize(); const int newAlpha = 8; window->setProperty("_d_dxcb_TransparentBackground", format.hasAlpha()); if (!DPlatformWindowHelper::windowRedirectContent(window)) { if (oldAlpha != newAlpha) { format.setAlphaBufferSize(newAlpha); window->setFormat(format); } } } QPlatformWindow *w = DPlatformIntegrationParent::createPlatformWindow(window); QNativeWindow *xw = static_cast(w); if (isUseDxcb) { #ifdef USE_NEW_IMPLEMENTING Q_UNUSED(new DPlatformWindowHelper(xw)) #else Q_UNUSED(new DPlatformWindowHook(xw)) #endif } #ifdef Q_OS_LINUX const DFrameWindow *frame_window = qobject_cast(window); bool rc = false; if (isUseDxcb) { rc = frame_window ? DPlatformWindowHelper::windowRedirectContent(frame_window->m_contentWindow) : DPlatformWindowHelper::windowRedirectContent(window); } WindowEventHook::init(xw, rc); #endif // QWindow *tp_for_window = window->transientParent(); // if (tp_for_window) { // // reset transient parent // if (DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(tp_for_window->handle())) { // window->setTransientParent(helper->m_frameWindow); // } // } if (window->type() != Qt::Desktop && !frame_window) { if (window->property(groupLeader).isValid()) { Utility::setWindowGroup(w->winId(), qvariant_cast(window->property(groupLeader))); } #ifdef Q_OS_LINUX else { Utility::setWindowGroup(w->winId(), xcbConnection()->clientLeader()); } #endif // for hi dpi if (!isUseDxcb && DHighDpi::overrideBackingStore() && (window->surfaceType() == QWindow::RasterSurface || dynamic_cast(window) || window->inherits("QWidgetWindow")) && !window->property("_d_dxcb_BackingStore").isValid()) { bool ok = VtableHook::overrideVfptrFun(w, &QPlatformWindow::devicePixelRatio, &DHighDpi::devicePixelRatio); if (ok) { window->setProperty("_d_dxcb_overrideBackingStore", true); } } } if (DBackingStoreProxy::useWallpaperPaint(window)) { QPair wallpaper_pair = window->property("_d_dxcb_wallpaper").value>(); Utility::updateBackgroundWallpaper(w->winId(), wallpaper_pair.first, wallpaper_pair.second); } return xw; } QPlatformWindow *DPlatformIntegration::createForeignWindow(QWindow *window, WId winId) const { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return DPlatformIntegrationParent::createForeignWindow(window, winId); #else Q_ASSERT(winId > 0); return new DForeignPlatformWindow(window, winId); #endif } QPlatformBackingStore *DPlatformIntegration::createPlatformBackingStore(QWindow *window) const { qCDebug(lcDxcb) << "window:" << window << "window type:" << window->type() << "parent:" << window->parent(); QPlatformBackingStore *store = DPlatformIntegrationParent::createPlatformBackingStore(window); bool useGLPaint = DBackingStoreProxy::useGLPaint(window); bool useWallpaper = DBackingStoreProxy::useWallpaperPaint(window); if (useGLPaint || useWallpaper || window->property("_d_dxcb_overrideBackingStore").toBool()) { // delegate of BackingStore for hidpi store = new DBackingStoreProxy(store, useGLPaint, useWallpaper); qInfo() << __FUNCTION__ << "enabled override backing store for:" << window; } if (window->type() == Qt::Desktop) return store; window->setProperty("_d_dxcb_BackingStore", reinterpret_cast(store)); if (window->property(useDxcb).toBool()) #ifdef USE_NEW_IMPLEMENTING if (!DPlatformWindowHelper::windowRedirectContent(window)) { m_storeHelper->addBackingStore(store); if (DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(window->handle())) { helper->m_frameWindow->m_contentBackingStore = store; } } #else return new DPlatformBackingStore(window, static_cast(store)); #endif return store; } QPlatformOpenGLContext *DPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { QPlatformOpenGLContext *p_context = DPlatformIntegrationParent::createPlatformOpenGLContext(context); // m_contextHelper->addOpenGLContext(context, p_context); return p_context; } QPaintEngine *DPlatformIntegration::createImagePaintEngine(QPaintDevice *paintDevice) const { static QPaintEngine::PaintEngineFeatures disable_features = QPaintEngine::PaintEngineFeatures(-1); if (int(disable_features) < 0) { disable_features = QPaintEngine::PaintEngineFeatures(); QByteArray data = qgetenv("DXCB_PAINTENGINE_DISABLE_FEATURES"); do { if (!data.isEmpty()) { bool ok = false; disable_features = QPaintEngine::PaintEngineFeatures(data.toInt(&ok, 16)); if (ok) break; disable_features = QPaintEngine::PaintEngineFeatures(); } QSettings settings(QSettings::IniFormat, QSettings::UserScope, "deepin", "qt-theme"); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) settings.setIniCodec("utf-8"); #endif settings.beginGroup("Platform"); bool ok = false; disable_features = QPaintEngine::PaintEngineFeatures(settings.value("PaintEngineDisableFeatures").toByteArray().toInt(&ok, 16)); if (!ok) disable_features = QPaintEngine::PaintEngineFeatures(); } while (false); } QPaintEngine *base_engine = DPlatformIntegrationParent::createImagePaintEngine(paintDevice); if (disable_features == 0) return base_engine; if (!base_engine) base_engine = new QRasterPaintEngine(paintDevice); DQPaintEngine *engine = static_cast(base_engine); engine->clearFeatures(disable_features); return engine; } QStringList DPlatformIntegration::themeNames() const { QStringList list = DPlatformIntegrationParent::themeNames(); const QByteArray desktop_session = qgetenv("DESKTOP_SESSION"); // 在lightdm环境中,无此环境变量 if (desktop_session.isEmpty() || desktop_session.startsWith("deepin")) list.prepend("deepin"); return list; } #define GET_VALID_XSETTINGS(key) { \ auto value = xSettings()->setting(key); \ if (value.isValid()) return value; \ } QVariant DPlatformIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { #ifdef Q_OS_LINUX switch ((int)hint) { case CursorFlashTime: if (enableCursorBlink()) { GET_VALID_XSETTINGS(XSETTINGS_CURSOR_BLINK_TIME); break; } else { return 0; } case MouseDoubleClickInterval: GET_VALID_XSETTINGS(XSETTINGS_DOUBLE_CLICK_TIME); break; case ShowShortcutsInContextMenus: return false; default: break; } #endif return DPlatformIntegrationParent::styleHint(hint); } #ifdef Q_OS_LINUX typedef int (*PtrXcursorLibraryLoadCursor)(void *, const char *); typedef char *(*PtrXcursorLibraryGetTheme)(void *); typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *); typedef int (*PtrXcursorLibraryGetDefaultSize)(void *); #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #include enum { XCursorShape = CursorShape }; #undef CursorShape static PtrXcursorLibraryLoadCursor ptrXcursorLibraryLoadCursor = 0; static PtrXcursorLibraryGetTheme ptrXcursorLibraryGetTheme = 0; static PtrXcursorLibrarySetTheme ptrXcursorLibrarySetTheme = 0; static PtrXcursorLibraryGetDefaultSize ptrXcursorLibraryGetDefaultSize = 0; static xcb_font_t cursorFont = 0; #endif static int cursorIdForShape(int cshape) { int cursorId = 0; switch (cshape) { case Qt::ArrowCursor: cursorId = XC_left_ptr; break; case Qt::UpArrowCursor: cursorId = XC_center_ptr; break; case Qt::CrossCursor: cursorId = XC_crosshair; break; case Qt::WaitCursor: cursorId = XC_watch; break; case Qt::IBeamCursor: cursorId = XC_xterm; break; case Qt::SizeAllCursor: cursorId = XC_fleur; break; case Qt::PointingHandCursor: cursorId = XC_hand2; break; case Qt::SizeBDiagCursor: cursorId = XC_top_right_corner; break; case Qt::SizeFDiagCursor: cursorId = XC_bottom_right_corner; break; case Qt::SizeVerCursor: case Qt::SplitVCursor: cursorId = XC_sb_v_double_arrow; break; case Qt::SizeHorCursor: case Qt::SplitHCursor: cursorId = XC_sb_h_double_arrow; break; case Qt::WhatsThisCursor: cursorId = XC_question_arrow; break; case Qt::ForbiddenCursor: cursorId = XC_circle; break; case Qt::BusyCursor: cursorId = XC_watch; break; default: break; } return cursorId; } static const char * const cursorNames[] = { "left_ptr", "up_arrow", "cross", "wait", "ibeam", "size_ver", "size_hor", "size_bdiag", "size_fdiag", "size_all", "blank", "split_v", "split_h", "pointing_hand", "forbidden", "whats_this", "left_ptr_watch", "openhand", "closedhand", "copy", "move", "link" }; static xcb_cursor_t loadCursor(void *dpy, int cshape) { xcb_cursor_t cursor = XCB_NONE; if (!ptrXcursorLibraryLoadCursor || !dpy) return cursor; switch (cshape) { case Qt::DragCopyCursor: cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-copy"); break; case Qt::DragMoveCursor: cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-move"); break; case Qt::DragLinkCursor: cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-link"); break; default: break; } if (!cursor) { cursor = ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]); } return cursor; } static xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot) { #ifdef XCB_USE_RENDER xcb_connection_t *conn = screen->xcb_connection(); const int w = image.width(); const int h = image.height(); xcb_generic_error_t *error = 0; xcb_render_query_pict_formats_cookie_t formatsCookie = xcb_render_query_pict_formats(conn); xcb_render_query_pict_formats_reply_t *formatsReply = xcb_render_query_pict_formats_reply(conn, formatsCookie, &error); if (!formatsReply || error) { qWarning("qt_xcb_createCursorXRender: query_pict_formats failed"); free(formatsReply); free(error); return XCB_NONE; } xcb_render_pictforminfo_t *fmt = xcb_render_util_find_standard_format(formatsReply, XCB_PICT_STANDARD_ARGB_32); if (!fmt) { qWarning("qt_xcb_createCursorXRender: Failed to find format PICT_STANDARD_ARGB_32"); free(formatsReply); return XCB_NONE; } QImage img = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); xcb_image_t *xi = xcb_image_create(w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, 32, 32, 32, 32, QSysInfo::ByteOrder == QSysInfo::BigEndian ? XCB_IMAGE_ORDER_MSB_FIRST : XCB_IMAGE_ORDER_LSB_FIRST, XCB_IMAGE_ORDER_MSB_FIRST, 0, 0, 0); if (!xi) { qWarning("qt_xcb_createCursorXRender: xcb_image_create failed"); free(formatsReply); return XCB_NONE; } xi->data = (uint8_t *) malloc(xi->stride * h); if (!xi->data) { qWarning("qt_xcb_createCursorXRender: Failed to malloc() image data"); xcb_image_destroy(xi); free(formatsReply); return XCB_NONE; } memcpy(xi->data, img.constBits(), img.sizeInBytes()); xcb_pixmap_t pix = xcb_generate_id(conn); xcb_create_pixmap(conn, 32, pix, screen->root(), w, h); xcb_render_picture_t pic = xcb_generate_id(conn); xcb_render_create_picture(conn, pic, pix, fmt->id, 0, 0); xcb_gcontext_t gc = xcb_generate_id(conn); xcb_create_gc(conn, gc, pix, 0, 0); xcb_image_put(conn, pix, gc, xi, 0, 0, 0); xcb_free_gc(conn, gc); xcb_cursor_t cursor = xcb_generate_id(conn); xcb_render_create_cursor(conn, cursor, pic, spot.x(), spot.y()); free(xi->data); xcb_image_destroy(xi); xcb_render_free_picture(conn, pic); xcb_free_pixmap(conn, pix); free(formatsReply); return cursor; #else Q_UNUSED(screen); Q_UNUSED(image); Q_UNUSED(spot); return XCB_NONE; #endif } static uint8_t cur_blank_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static xcb_cursor_t overrideCreateNonStandardCursor(QXcbCursor *xcb_cursor, Qt::CursorShape cshape, QWindow *window) { xcb_cursor_t cursor = 0; xcb_connection_t *conn = xcb_cursor->xcb_connection(); QImage image; switch (cshape) { case Qt::BlankCursor: { xcb_pixmap_t cp = xcb_create_pixmap_from_bitmap_data(conn, xcb_cursor->m_screen->root(), cur_blank_bits, 16, 16, 1, 0, 0, 0); xcb_pixmap_t mp = xcb_create_pixmap_from_bitmap_data(conn, xcb_cursor->m_screen->root(), cur_blank_bits, 16, 16, 1, 0, 0, 0); cursor = xcb_generate_id(conn); xcb_create_cursor(conn, cursor, cp, mp, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8); return cursor; } case Qt::SizeVerCursor: image.load(":/bottom_side.png"); break; case Qt::SizeAllCursor: image.load(":/all-scroll.png"); break; case Qt::SplitVCursor: image.load(":/sb_v_double_arrow.png"); break; case Qt::SplitHCursor: image.load(":/sb_h_double_arrow.png"); break; case Qt::WhatsThisCursor: image.load(":/question_arrow.png"); break; case Qt::BusyCursor: image.load(":/left_ptr_watch_0001.png"); break; case Qt::ForbiddenCursor: image.load(":/crossed_circle.png"); break; case Qt::OpenHandCursor: image.load(":/hand1.png"); break; case Qt::ClosedHandCursor: image.load(":/grabbing.png"); break; case Qt::DragCopyCursor: image.load(":/dnd-copy.png"); break; case Qt::DragMoveCursor: image.load(":/dnd-move.png"); break; case Qt::DragLinkCursor: image.load(":/dnd-link.png"); break; default: break; } if (!image.isNull()) { image = image.scaledToWidth(24 * window->devicePixelRatio()); cursor = qt_xcb_createCursorXRender(xcb_cursor->m_screen, image, QPoint(8, 8) * window->devicePixelRatio()); } return cursor; } static bool updateCursorTheme(void *dpy) { if (!ptrXcursorLibraryGetTheme || !ptrXcursorLibrarySetTheme) return false; QByteArray theme = ptrXcursorLibraryGetTheme(dpy); int setTheme = ptrXcursorLibrarySetTheme(dpy,theme.constData()); return setTheme; } static xcb_cursor_t overrideCreateFontCursor(QXcbCursor *xcb_cursor, QCursor *c, QWindow *window) { const Qt::CursorShape cshape = c->shape(); xcb_connection_t *conn = xcb_cursor->xcb_connection(); int cursorId = cursorIdForShape(cshape); xcb_cursor_t cursor = XCB_NONE; // Try Xcursor first #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) if (cshape >= 0 && cshape <= Qt::LastCursor) { void *dpy = xcb_cursor->connection()->xlib_display(); // special case for non-standard dnd-* cursors cursor = loadCursor(dpy, cshape); #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) if (!cursor && !xcb_cursor->m_callbackForPropertyRegistered) { #else if (!cursor && !xcb_cursor->m_gtkCursorThemeInitialized) { #endif VtableHook::callOriginalFun(xcb_cursor, &QPlatformCursor::changeCursor, c, window); if (updateCursorTheme(dpy)) { cursor = loadCursor(dpy, cshape); } } } if (cursor) return cursor; if (!cursor && cursorId) { #ifdef DISPLAY_FROM_XCB cursor = XCreateFontCursor(DISPLAY_FROM_XCB(xcb_cursor), cursorId); #else cursor = XCreateFontCursor(static_cast(xcb_cursor->connection()->xlib_display()), cursorId); #endif if (cursor) return cursor; } #endif // Non-standard X11 cursors are created from bitmaps cursor = overrideCreateNonStandardCursor(xcb_cursor, cshape, window); // Create a glyph cursor if everything else failed if (!cursor && cursorId) { cursor = xcb_generate_id(conn); xcb_create_glyph_cursor(conn, cursor, cursorFont, cursorFont, cursorId, cursorId + 1, 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); } if (cursor && cshape >= 0 && cshape < Qt::LastCursor && xcb_cursor->connection()->hasXFixes()) { const char *name = cursorNames[cshape]; xcb_xfixes_set_cursor_name(conn, cursor, strlen(name), name); } return cursor; } static void overrideChangeCursor(QPlatformCursor *cursorHandle, QCursor * cursor, QWindow * widget) { QXcbWindow *w = nullptr; if (widget && widget->handle()) w = static_cast(widget->handle()); else // No X11 cursor control when there is no widget under the cursor return; if (widget->property(disableOverrideCursor).toBool()) return; #ifdef D_ENABLE_CURSOR_HOOK // set cursor size scale static bool xcursrSizeIsSet = qEnvironmentVariableIsSet("XCURSOR_SIZE"); if (!xcursrSizeIsSet) qputenv("XCURSOR_SIZE", QByteArray::number(24 * qApp->devicePixelRatio())); QXcbCursor *xcb_cursor = static_cast(cursorHandle); xcb_cursor_t c = XCB_CURSOR_NONE; if (cursor && cursor->shape() != Qt::BitmapCursor) { const QXcbCursorCacheKey key(cursor->shape()); QXcbCursor::CursorHash::iterator it = xcb_cursor->m_cursorHash.find(key); if (it == xcb_cursor->m_cursorHash.end()) { it = xcb_cursor->m_cursorHash.insert(key, overrideCreateFontCursor(xcb_cursor, cursor, widget)); } c = it.value(); #if QT_VERSION < QT_VERSION_CHECK(5, 7, 1) w->setCursor(c); #elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0) w->setCursor(c, false); #else xcb_change_window_attributes(DPlatformIntegration::xcbConnection()->xcb_connection(), w->xcb_window(), XCB_CW_CURSOR, &c); xcb_flush(DPlatformIntegration::xcbConnection()->xcb_connection()); #endif } #endif // D_ENABLE_CURSOR_HOOK VtableHook::callOriginalFun(cursorHandle, &QPlatformCursor::changeCursor, cursor, widget); } static void hookXcbCursor(QScreen *screen) { // 解决切换光标主题,光标没有适配当前主题,显示错乱的问题 if (screen && screen->handle()) VtableHook::overrideVfptrFun(screen->handle()->cursor(), &QPlatformCursor::changeCursor, &overrideChangeCursor); } #endif // Q_OS_LINUX static bool hookDragObjectEventFilter(QBasicDrag *drag, QObject *o, QEvent *e) { if (e->type() == QEvent::MouseMove) { return drag->QBasicDrag::eventFilter(o, e); } return VtableHook::callOriginalFun(drag, &QObject::eventFilter, o, e); } #ifdef Q_OS_LINUX typedef QXcbScreen QNativeScreen; #elif defined(Q_OS_WIN) typedef QWindowsScreen QNativeScreen; #endif QWindow *overrideTopLevelAt(QPlatformScreen *s, const QPoint &point) { QWindow *window = static_cast(s)->QNativeScreen::topLevelAt(point); if (DFrameWindow *fw = qobject_cast(window)) { return fw->contentWindow(); } return window; } static void hookScreenGetWindow(QScreen *screen) { if (screen && screen->handle()) VtableHook::overrideVfptrFun(screen->handle(), &QPlatformScreen::topLevelAt, &overrideTopLevelAt); } static void watchScreenDPIChange(QScreen *screen) { if (screen && screen->handle()) { DPlatformIntegration::instance()->xSettings()->registerCallbackForProperty("Qt/DPI/" + screen->name().toLocal8Bit(), &DHighDpi::onDPIChanged, screen); } else { qWarning("screen or handle is nullptr!"); } } static void startDrag(QXcbDrag *drag) { VtableHook::callOriginalFun(drag, &QXcbDrag::startDrag); QVector support_actions; const Qt::DropActions actions = drag->currentDrag()->supportedActions(); if (actions.testFlag(Qt::CopyAction)) support_actions << drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionCopy)); if (actions.testFlag(Qt::MoveAction)) support_actions << drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionMove)); if (actions.testFlag(Qt::LinkAction)) support_actions << drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionLink)); // 此处不能直接 return ,因为一个拖拽包含多种 actions 后再次拖拽单一 action 时需要将 property 更新, 否则单一 actoin 的拖拽会被强行改成 // 上一次的 actions, 导致某些小问题 (比如文管的拖拽行为不一致的问题) // if (support_actions.size() < 2) // return; #if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) xcb_change_property(drag->xcb_connection(), XCB_PROP_MODE_REPLACE, drag->connection()->clipboard()->m_owner, drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionList)), XCB_ATOM_ATOM, sizeof(xcb_atom_t) * 8, support_actions.size(), support_actions.constData()); #else xcb_change_property(drag->xcb_connection(), XCB_PROP_MODE_REPLACE, drag->connection()->clipboard()->m_requestor, //TODO: m_ower deleted, replaced by m_requestor ? drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionList)), XCB_ATOM_ATOM, sizeof(xcb_atom_t) * 8, support_actions.size(), support_actions.constData()); #endif xcb_flush(drag->xcb_connection()); } static void cursorThemePropertyChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle) { Q_UNUSED(connection); Q_UNUSED(name); Q_UNUSED(property); Q_UNUSED(handle) QMetaObject::invokeMethod(qApp, [](){ for (const auto window : qApp->allWindows()) { auto cursor = window->cursor(); if (window->screen() && window->screen()->handle() && window->screen()->handle()->cursor()) overrideChangeCursor(window->screen()->handle()->cursor(), &cursor, window); } }, Qt::QueuedConnection); } void DPlatformIntegration::initialize() { // 由于Qt很多代码中写死了是xcb,所以只能伪装成是xcb // FIXME: set platform_name to xcb to avoid webengine crash // It need dtk update tag, make it default when dtk udate if (qgetenv("DXCB_FAKE_PLATFORM_NAME_XCB") != "0") { *QGuiApplicationPrivate::platform_name = "xcb"; } qApp->setProperty("_d_isDxcb", true); QXcbIntegration::initialize(); // 配置opengl渲染模块类型 QByteArray opengl_module_type = qgetenv("D_OPENGL_MODULE_TYPE"); if(!opengl_module_type.isEmpty()) { QSurfaceFormat format = QSurfaceFormat::defaultFormat(); QSurfaceFormat::RenderableType module = opengl_module_type.contains("gles") ? QSurfaceFormat::OpenGLES : QSurfaceFormat::OpenGL; format.setRenderableType(module); QSurfaceFormat::setDefaultFormat(format); } #ifdef Q_OS_LINUX #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) m_eventFilter = new XcbNativeEventFilter(connection()); #else m_eventFilter = new XcbNativeEventFilter(defaultConnection()); #endif qApp->installNativeEventFilter(m_eventFilter); if (!qEnvironmentVariableIsSet("DXCB_DISABLE_HOOK_CURSOR")) { #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static bool function_ptrs_not_initialized = true; if (function_ptrs_not_initialized) { QLibrary xcursorLib(QLatin1String("Xcursor"), 1); bool xcursorFound = xcursorLib.load(); if (!xcursorFound) { // try without the version number xcursorLib.setFileName(QLatin1String("Xcursor")); xcursorFound = xcursorLib.load(); } if (xcursorFound) { ptrXcursorLibraryLoadCursor = (PtrXcursorLibraryLoadCursor) xcursorLib.resolve("XcursorLibraryLoadCursor"); ptrXcursorLibraryGetTheme = (PtrXcursorLibraryGetTheme) xcursorLib.resolve("XcursorGetTheme"); ptrXcursorLibrarySetTheme = (PtrXcursorLibrarySetTheme) xcursorLib.resolve("XcursorSetTheme"); ptrXcursorLibraryGetDefaultSize = (PtrXcursorLibraryGetDefaultSize) xcursorLib.resolve("XcursorGetDefaultSize"); } function_ptrs_not_initialized = false; } #endif //#ifdef D_ENABLE_CURSOR_HOOK for (QScreen *s : qApp->screens()) { hookXcbCursor(s); } QObject::connect(qApp, &QGuiApplication::screenAdded, qApp, &hookXcbCursor); //#endif // D_ENABLE_CURSOR_HOOK } VtableHook::overrideVfptrFun(xcbConnection()->drag(), &QXcbDrag::startDrag, &startDrag); #endif VtableHook::overrideVfptrFun(qApp->d_func(), &QGuiApplicationPrivate::isWindowBlocked, this, &DPlatformIntegration::isWindowBlockedHandle); // FIXME(zccrs): 修复启动drag后鼠标从一块屏幕移动到另一块后图标窗口位置不对 VtableHook::overrideVfptrFun(static_cast(drag()), &QBasicDrag::eventFilter, &hookDragObjectEventFilter); for (QScreen *s : qApp->screens()) { hookScreenGetWindow(s); if (DHighDpi::isActive()) { // 监听屏幕dpi变化 watchScreenDPIChange(s); } } QObject::connect(qApp, &QGuiApplication::screenAdded, qApp, &hookScreenGetWindow); if (DHighDpi::isActive()) { // 监听屏幕dpi变化 QObject::connect(qApp, &QGuiApplication::screenAdded, qApp, &watchScreenDPIChange); } if (QGuiApplicationPrivate::instance()->platformIntegration()->services()->desktopEnvironment().toLower().endsWith("tablet")) { m_pApplicationEventMonitor.reset(new DApplicationEventMonitor); QObject::connect(m_pApplicationEventMonitor.data(), &DApplicationEventMonitor::lastInputDeviceTypeChanged, qApp, [this] { // 这里为了不重复对g_desktopInputSelectionControl 做初始化设定, 做一个exists判定 if (!m_pDesktopInputSelectionControl && m_pApplicationEventMonitor->lastInputDeviceType() == DApplicationEventMonitor::TouchScreen) { m_pDesktopInputSelectionControl.reset(new DDesktopInputSelectionControl(nullptr, qApp->inputMethod())); m_pDesktopInputSelectionControl->createHandles(); m_pDesktopInputSelectionControl->setApplicationEventMonitor(m_pApplicationEventMonitor.data()); } }); // 适配虚拟键盘 if (DPlatformInputContextHook::instance()->isValid()) { inputContextHookFunc(); } else { // 虚拟键盘服务未启动时,开始监听DBUS // 待虚拟键盘启动后 Hook QPlatformInputContext函数 // 该连接将一直存在防止使用中虚拟键盘服务重启 OrgFreedesktopDBusInterface *interface = new OrgFreedesktopDBusInterface("org.freedesktop.DBus", "/org/freedesktop/DBus", QDBusConnection::sessionBus(), qApp); QObject::connect(interface, &OrgFreedesktopDBusInterface::NameOwnerChanged, qApp, [ = ](const QString &in0, const QString &in1, const QString &in2){ Q_UNUSED(in1) Q_UNUSED(in2) if (in0 == "com.deepin.im") { inputContextHookFunc(); QObject::disconnect(interface, &OrgFreedesktopDBusInterface::NameOwnerChanged, nullptr, nullptr); interface->deleteLater(); } }); } } // Qt中同样监听了这个属性的变化,但是只刷新了光标上下文却没有更新当前窗口的光标,无法做到光标的实时变化,所以加了该逻辑额外处理 xSettings()->registerCallbackForProperty("Gtk/CursorThemeName", cursorThemePropertyChanged, nullptr); } #ifdef Q_OS_LINUX static void onXSettingsChanged(xcb_connection_t *connection, const QByteArray &name, const QVariant &property, void *handle) { Q_UNUSED(connection) Q_UNUSED(property) Q_UNUSED(name) if (handle == reinterpret_cast(QPlatformIntegration::CursorFlashTime)) { // 由于QStyleHints中的属性值可能已经被自定义,因此不应该使用property中的值 // 此处只表示 QStyleHints 的 cursorFlashTime 属性可能变了 Q_EMIT qGuiApp->styleHints()->cursorFlashTimeChanged(qGuiApp->styleHints()->cursorFlashTime()); } } bool DPlatformIntegration::enableCursorBlink() const { auto value = xSettings()->setting(XSETTINGS_CURSOR_BLINK); bool ok = false; int enable = value.toInt(&ok); return !ok || enable; } DXcbXSettings *DPlatformIntegration::xSettings(bool onlyExists) const { if (onlyExists) return m_xsettings; return xSettings(xcbConnection()); } DXcbXSettings *DPlatformIntegration::xSettings(QXcbConnection *connection) { if (!m_xsettings) { auto xsettings = new DXcbXSettings(connection->xcb_connection()); m_xsettings = xsettings; // 注册回调,用于通知 QStyleHints 属性改变 xsettings->registerCallbackForProperty(XSETTINGS_CURSOR_BLINK_TIME, onXSettingsChanged, reinterpret_cast(CursorFlashTime)); xsettings->registerCallbackForProperty(XSETTINGS_CURSOR_BLINK, onXSettingsChanged, reinterpret_cast(CursorFlashTime)); if (DHighDpi::isActive()) { // 监听XSettings的dpi设置变化 xsettings->registerCallbackForProperty("Xft/DPI", &DHighDpi::onDPIChanged, nullptr); } } return m_xsettings; } #endif bool DPlatformIntegration::isWindowBlockedHandle(QWindow *window, QWindow **blockingWindow) { if (DFrameWindow *frame = qobject_cast(window)) { bool blocked = VtableHook::callOriginalFun(qApp->d_func(), &QGuiApplicationPrivate::isWindowBlocked, frame->m_contentWindow, blockingWindow); // NOTE(zccrs): 将内容窗口的blocked状态转移到frame窗口,否则会被QXcbWindow::relayFocusToModalWindow重复调用requestActivate而引起死循环 if (blockingWindow && frame->m_contentWindow.data() == *blockingWindow) { *blockingWindow = window; } return blocked; } return VtableHook::callOriginalFun(qApp->d_func(), &QGuiApplicationPrivate::isWindowBlocked, window, blockingWindow); } void DPlatformIntegration::inputContextHookFunc() { // if (!VtableHook::hasVtable(inputContext())) { VtableHook::overrideVfptrFun(inputContext(), &QPlatformInputContext::showInputPanel, &DPlatformInputContextHook::showInputPanel); VtableHook::overrideVfptrFun(inputContext(), &QPlatformInputContext::hideInputPanel, &DPlatformInputContextHook::hideInputPanel); VtableHook::overrideVfptrFun(inputContext(), &QPlatformInputContext::isInputPanelVisible, &DPlatformInputContextHook::isInputPanelVisible); VtableHook::overrideVfptrFun(inputContext(), &QPlatformInputContext::keyboardRect, &DPlatformInputContextHook::keyboardRect); QObject::connect(DPlatformInputContextHook::instance(), &ComDeepinImInterface::geometryChanged, inputContext(), &QPlatformInputContext::emitKeyboardRectChanged); QObject::connect(DPlatformInputContextHook::instance(), &ComDeepinImInterface::imActiveChanged, inputContext(), &QPlatformInputContext::emitInputPanelVisibleChanged); // } } void DPlatformIntegration::sendEndStartupNotifition() { QByteArray message, startupid; if (QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) startupid = (const char *)ni->nativeResourceForIntegration(QByteArrayLiteral("startupid")); if (startupid.isEmpty()) return ; message = QByteArrayLiteral("remove: ID=") + startupid; xcb_client_message_event_t ev; ev.response_type = XCB_CLIENT_MESSAGE; ev.format = 8; ev.type = xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_STARTUP_INFO_BEGIN)); ev.sequence = 0; ev.window = xcbConnection()->rootWindow(); int sent = 0; int length = message.length() + 1; // include NUL byte const char *data = message.constData(); do { if (sent == 20) ev.type = xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_STARTUP_INFO)); const int start = sent; const int numBytes = qMin(length - start, 20); memcpy(ev.data.data8, data + start, numBytes); xcb_send_event(xcbConnection()->xcb_connection(), false, xcbConnection()->rootWindow(), XCB_EVENT_MASK_PROPERTY_CHANGE, (const char *) &ev); sent += numBytes; } while (sent < length); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformintegration.h000066400000000000000000000071721476226662200227500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef GENERICPLUGIN_H #define GENERICPLUGIN_H #include "global.h" #include #ifdef Q_OS_LINUX #define private protected #include "qxcbintegration.h" #undef private typedef QXcbIntegration DPlatformIntegrationParent; class QXcbVirtualDesktop; #elif defined(Q_OS_WIN) #include "qwindowsgdiintegration.h" typedef QWindowsGdiIntegration DPlatformIntegrationParent; #endif DPP_BEGIN_NAMESPACE class DPlatformWindowHook; class XcbNativeEventFilter; class DPlatformBackingStoreHelper; class DPlatformOpenGLContextHelper; class DXcbXSettings; class DApplicationEventMonitor; class DDesktopInputSelectionControl; class DPlatformIntegration : public DPlatformIntegrationParent { public: DPlatformIntegration(const QStringList ¶meters, int &argc, char **argv); ~DPlatformIntegration(); static void setWindowProperty(QWindow *window, const char *name, const QVariant &value); static bool enableDxcb(QWindow *window); static bool isEnableDxcb(const QWindow *window); static bool setEnableNoTitlebar(QWindow *window, bool enable); static bool isEnableNoTitlebar(const QWindow *window); // Warning: 调用 buildNativeSettings,会导致object的QMetaObject对象被更改 // 无法使用QMetaObject::cast,不能使用QObject::findChild等接口查找子类,也不能使用qobject_cast转换对象指针类型 static bool buildNativeSettings(QObject *object, quint32 settingWindow); static void clearNativeSettings(quint32 settingWindow); static void setWMClassName(const QByteArray &name); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; QPlatformWindow *createForeignWindow(QWindow *window, WId winId) const Q_DECL_OVERRIDE; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const override; QStringList themeNames() const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const override; void initialize() Q_DECL_OVERRIDE; #ifdef Q_OS_LINUX #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) static DPlatformIntegration *instance() { return m_instance; } private: static DPlatformIntegration *m_instance; #endif inline static DPlatformIntegration *instance() { return static_cast(DPlatformIntegrationParent::instance());} inline static QXcbConnection *xcbConnection() { #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) return instance()->connection(); #else return instance()->defaultConnection(); #endif } inline XcbNativeEventFilter *eventFilter() { return m_eventFilter;} bool enableCursorBlink() const; DXcbXSettings *xSettings(bool onlyExists = false) const; static DXcbXSettings *xSettings(QXcbConnection *connection); static void sendEndStartupNotifition(); private: XcbNativeEventFilter *m_eventFilter = Q_NULLPTR; static DXcbXSettings *m_xsettings; #endif private: // handle the DFrameWindow modal blocked state bool isWindowBlockedHandle(QWindow *window, QWindow **blockingWindow); void inputContextHookFunc(); DPlatformBackingStoreHelper *m_storeHelper; DPlatformOpenGLContextHelper *m_contextHelper; QScopedPointer m_pApplicationEventMonitor; QScopedPointer m_pDesktopInputSelectionControl; }; DPP_END_NAMESPACE #endif // GENERICPLUGIN_H qt5platform-plugins-5.7.12/xcb/dplatformnativeinterfacehook.cpp000066400000000000000000000136351476226662200250110ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dplatformnativeinterfacehook.h" #include "global.h" #include "utility.h" #include "dplatformwindowhelper.h" #include "dplatformintegration.h" #include "dwmsupport.h" #ifdef Q_OS_LINUX #include "xcbnativeeventfilter.h" #include "qxcbnativeinterface.h" typedef QXcbNativeInterface DPlatformNativeInterface; #elif defined(Q_OS_WIN) #include "qwindowsgdinativeinterface.h" typedef QWindowsGdiNativeInterface DPlatformNativeInterface; #endif DPP_BEGIN_NAMESPACE static QString version() { return QStringLiteral(DXCB_VERSION); } #ifdef Q_OS_LINUX static DeviceType _inputEventSourceDevice(const QInputEvent *event) { return DPlatformIntegration::instance()->eventFilter()->xiEventSource(event); } #endif static QFunctionPointer getFunction(const QByteArray &function) { static QHash functionCache = { {setWmBlurWindowBackgroundArea, reinterpret_cast(&Utility::blurWindowBackground)}, {setWmBlurWindowBackgroundPathList, reinterpret_cast(&Utility::blurWindowBackgroundByPaths)}, {setWmBlurWindowBackgroundMaskImage, reinterpret_cast(&Utility::blurWindowBackgroundByImage)}, {setWmWallpaperParameter, reinterpret_cast(&Utility::updateBackgroundWallpaper)}, {hasBlurWindow, reinterpret_cast(&DWMSupport::Global::hasBlurWindow)}, {hasComposite, reinterpret_cast(&DWMSupport::Global::hasComposite)}, {hasNoTitlebar, reinterpret_cast(&DWMSupport::Global::hasNoTitlebar)}, {hasWindowAlpha, reinterpret_cast(&DWMSupport::Global::hasWindowAlpha)}, {hasWallpaperEffect, reinterpret_cast(&DWMSupport::Global::hasWallpaperEffect)}, {windowManagerName, reinterpret_cast(&DWMSupport::Global::windowManagerName)}, {connectWindowManagerChangedSignal, reinterpret_cast(&DWMSupport::connectWindowManagerChangedSignal)}, {connectHasBlurWindowChanged, reinterpret_cast(&DWMSupport::connectHasBlurWindowChanged)}, {connectHasCompositeChanged, reinterpret_cast(&DWMSupport::connectHasCompositeChanged)}, {connectHasNoTitlebarChanged, reinterpret_cast(&DWMSupport::connectHasNoTitlebarChanged)}, {connectHasWallpaperEffectChanged, reinterpret_cast(&DWMSupport::connectHasWallpaperEffectChanged)}, {getWindows, reinterpret_cast(&Utility::getWindows)}, {windowFromPoint, reinterpret_cast(&Utility::windowFromPoint)}, {getCurrentWorkspaceWindows, reinterpret_cast(&Utility::getCurrentWorkspaceWindows)}, {connectWindowListChanged, reinterpret_cast(&DWMSupport::connectWindowListChanged)}, {setMWMFunctions, reinterpret_cast(&DWMSupport::setMWMFunctions)}, {getMWMFunctions, reinterpret_cast(&DWMSupport::getMWMFunctions)}, {setMWMDecorations, reinterpret_cast(&DWMSupport::setMWMDecorations)}, {getMWMDecorations, reinterpret_cast(&DWMSupport::getMWMDecorations)}, {connectWindowMotifWMHintsChanged, reinterpret_cast(&DWMSupport::connectWindowMotifWMHintsChanged)}, {popupSystemWindowMenu, reinterpret_cast(&DWMSupport::popupSystemWindowMenu)}, {setWindowProperty, reinterpret_cast(&DPlatformIntegration::setWindowProperty)}, {pluginVersion, reinterpret_cast(&version)}, {inputEventSourceDevice, reinterpret_cast(&_inputEventSourceDevice)}, {createGroupWindow, reinterpret_cast(&Utility::createGroupWindow)}, {destoryGroupWindow, reinterpret_cast(&Utility::destoryGroupWindow)}, {setWindowGroup, reinterpret_cast(&Utility::setWindowGroup)}, {clientLeader, reinterpret_cast(&Utility::clientLeader)}, {enableDxcb, reinterpret_cast(&DPlatformIntegration::enableDxcb)}, {isEnableDxcb, reinterpret_cast(&DPlatformIntegration::isEnableDxcb)}, {setEnableNoTitlebar, reinterpret_cast(&DPlatformIntegration::setEnableNoTitlebar)}, {isEnableNoTitlebar, reinterpret_cast(&DPlatformIntegration::isEnableNoTitlebar)}, {buildNativeSettings, reinterpret_cast(&DPlatformIntegration::buildNativeSettings)}, {clearNativeSettings, reinterpret_cast(&DPlatformIntegration::clearNativeSettings)}, {setWMClassName, reinterpret_cast(&DPlatformIntegration::setWMClassName)}, {splitWindowOnScreen, reinterpret_cast(&Utility::splitWindowOnScreen)}, {supportForSplittingWindow, reinterpret_cast(&Utility::supportForSplittingWindow)}, {sendEndStartupNotifition, reinterpret_cast(&DPlatformIntegration::sendEndStartupNotifition)}, {splitWindowOnScreenByType, reinterpret_cast(&Utility::splitWindowOnScreenByType)}, {supportForSplittingWindowByType, reinterpret_cast(&Utility::supportForSplittingWindowByType)} }; return functionCache.value(function); } QFunctionPointer DPlatformNativeInterfaceHook::platformFunction(QPlatformNativeInterface *interface, const QByteArray &function) { QFunctionPointer f = getFunction(function); #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) if (!f) { f = static_cast(interface)->DPlatformNativeInterface::platformFunction(function); } #endif return f; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformnativeinterfacehook.h000066400000000000000000000010421476226662200244430ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DPLATFORMNATIVEINTERFACE_H #define DPLATFORMNATIVEINTERFACE_H #include #include "global.h" QT_BEGIN_NAMESPACE class QPlatformNativeInterface; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DPlatformNativeInterfaceHook { public: static QFunctionPointer platformFunction(QPlatformNativeInterface *interface, const QByteArray &function); }; DPP_END_NAMESPACE #endif // DPLATFORMNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/dplatformopenglcontexthelper.cpp000066400000000000000000000121571476226662200250500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dplatformopenglcontexthelper.h" #include "vtablehook.h" #include "dplatformwindowhelper.h" #include "dframewindow.h" #include "dwmsupport.h" #include #include #include #include #include #include #include #include DPP_BEGIN_NAMESPACE DPlatformOpenGLContextHelper::DPlatformOpenGLContextHelper() { } bool DPlatformOpenGLContextHelper::addOpenGLContext(QOpenGLContext *object, QPlatformOpenGLContext *context) { Q_UNUSED(object) return VtableHook::overrideVfptrFun(context, &QPlatformOpenGLContext::swapBuffers, this, &DPlatformOpenGLContextHelper::swapBuffers); } static void drawCornerImage(const QImage &source, const QPoint &source_offset, QPainter *dest, const QPainterPath &dest_path, QOpenGLFunctions *glf) { if (source.isNull()) return; const QRectF &br = dest_path.boundingRect(); if (br.isEmpty()) return; int height = dest->device()->height(); QBrush brush(source); QImage tmp_image(br.size().toSize(), QImage::Format_RGBA8888); glf->glReadPixels(br.x(), height - br.y() - tmp_image.height(), tmp_image.width(), tmp_image.height(), GL_RGBA, GL_UNSIGNED_BYTE, tmp_image.bits()); tmp_image = tmp_image.mirrored(); brush.setTransform(QTransform(1, 0, 0, 1, -source_offset.x() - br.x(), -source_offset.y() - br.y())); QPainter pa(&tmp_image); pa.setRenderHint(QPainter::Antialiasing); pa.setCompositionMode(QPainter::CompositionMode_Source); pa.fillPath(dest_path.translated(-br.topLeft()), brush); pa.end(); dest->drawImage(br.topLeft(), tmp_image); } void DPlatformOpenGLContextHelper::swapBuffers(QPlatformSurface *surface) { if (!DWMSupport::instance()->hasWindowAlpha()) goto end; if (surface->surface()->surfaceClass() == QSurface::Window) { QWindow *window = static_cast(surface->surface()); DPlatformWindowHelper *window_helper = DPlatformWindowHelper::mapped.value(window->handle()); if (!window_helper) goto end; if (!window_helper->m_isUserSetClipPath && window_helper->getWindowRadius() <= 0) goto end; qreal device_pixel_ratio = window_helper->m_nativeWindow->window()->devicePixelRatio(); QPainterPath path; const QPainterPath &real_clip_path = window_helper->m_clipPath * device_pixel_ratio; const QSize &window_size = window->handle()->geometry().size(); path.addRect(QRect(QPoint(0, 0), window_size)); path -= real_clip_path; if (path.isEmpty()) goto end; QOpenGLPaintDevice device(window_size); QPainter pa_device(&device); pa_device.setCompositionMode(QPainter::CompositionMode_Source); if (window_helper->m_isUserSetClipPath) { const QRect &content_rect = QRect(window_helper->m_frameWindow->contentOffsetHint() * device_pixel_ratio, window_size); QBrush border_brush(window_helper->m_frameWindow->platformBackingStore->toImage()); border_brush.setTransform(QTransform(1, 0, 0, 1, -content_rect.x(), -content_rect.y())); pa_device.fillPath(path, border_brush); } else { const QImage &frame_image = window_helper->m_frameWindow->platformBackingStore->toImage(); const QRect background_rect(QPoint(0, 0), window_size); const QPoint offset = window_helper->m_frameWindow->contentOffsetHint() * device_pixel_ratio; QRect corner_rect(0, 0, window_helper->m_windowRadius * device_pixel_ratio, window_helper->m_windowRadius * device_pixel_ratio); QPainterPath corner_path; QOpenGLFunctions *gl_funcs = QOpenGLContext::currentContext()->functions(); // draw top-left corner_path.addRect(corner_rect); drawCornerImage(frame_image, offset, &pa_device, corner_path - real_clip_path, gl_funcs); // draw top-right corner_rect.moveTopRight(background_rect.topRight()); corner_path = QPainterPath(); corner_path.addRect(corner_rect); drawCornerImage(frame_image, offset, &pa_device, corner_path - real_clip_path, gl_funcs); // draw bottom-left corner_rect.moveBottomLeft(background_rect.bottomLeft()); corner_path = QPainterPath(); corner_path.addRect(corner_rect); drawCornerImage(frame_image, offset, &pa_device, corner_path - real_clip_path, gl_funcs); // draw bottom-right corner_rect.moveBottomRight(background_rect.bottomRight()); corner_path = QPainterPath(); corner_path.addRect(corner_rect); drawCornerImage(frame_image, offset, &pa_device, corner_path - real_clip_path, gl_funcs); } pa_device.end(); } end: VtableHook::callOriginalFun(this->context(), &QPlatformOpenGLContext::swapBuffers, surface); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformopenglcontexthelper.h000066400000000000000000000015041476226662200245070ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DPLATFORMOPENGLCONTEXTHELPER_H #define DPLATFORMOPENGLCONTEXTHELPER_H #include #include "global.h" QT_BEGIN_NAMESPACE class QPlatformOpenGLContext; class QPlatformSurface; class QOpenGLContext; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DPlatformOpenGLContextHelper { public: DPlatformOpenGLContextHelper(); bool addOpenGLContext(QOpenGLContext *object, QPlatformOpenGLContext *context); QPlatformOpenGLContext *context() const { return reinterpret_cast(const_cast(this));} void initialize(); void swapBuffers(QPlatformSurface *surface); }; DPP_END_NAMESPACE #endif // DPLATFORMOPENGLCONTEXTHELPER_H qt5platform-plugins-5.7.12/xcb/dplatformwindowhelper.cpp000066400000000000000000001502341476226662200234650ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dplatformwindowhelper.h" #include "dplatformintegration.h" #include "dframewindow.h" #include "vtablehook.h" #include "dwmsupport.h" #ifdef Q_OS_LINUX #include "xcbnativeeventfilter.h" #include "qxcbwindow.h" #include #include #include #endif #include #include #if QT_VERSION >= QT_VERSION_CHECK(6, 4, 2) #include #endif #include #include Q_DECLARE_METATYPE(QPainterPath) Q_DECLARE_METATYPE(QMargins) DPP_BEGIN_NAMESPACE #define HOOK_VFPTR(Fun) VtableHook::overrideVfptrFun(window, &QPlatformWindow::Fun, this, &DPlatformWindowHelper::Fun) #define CALL this->window()->QNativeWindow PUBLIC_CLASS(QWindow, DPlatformWindowHelper); PUBLIC_CLASS(QMouseEvent, DPlatformWindowHelper); PUBLIC_CLASS(QDropEvent, DPlatformWindowHelper); PUBLIC_CLASS(QNativeWindow, DPlatformWindowHelper); PUBLIC_CLASS(QWheelEvent, DPlatformWindowHelper); QHash DPlatformWindowHelper::mapped; DPlatformWindowHelper::DPlatformWindowHelper(QNativeWindow *window) : QObject(window->window()) , m_nativeWindow(window) { mapped[window] = this; m_frameWindow = new DFrameWindow(window->window()); m_frameWindow->setFlags((window->window()->flags() | Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::NoDropShadowWindowHint) & ~Qt::WindowMinMaxButtonsHint); m_frameWindow->create(); m_frameWindow->installEventFilter(this); m_frameWindow->setShadowRadius(getShadowRadius()); m_frameWindow->setShadowColor(m_shadowColor); m_frameWindow->setShadowOffset(m_shadowOffset); m_frameWindow->setBorderWidth(getBorderWidth()); m_frameWindow->setBorderColor(getBorderColor()); m_frameWindow->setEnableSystemMove(m_enableSystemMove); m_frameWindow->setEnableSystemResize(m_enableSystemResize); // 防止被自动更新窗口大小(参见:qdeepintheme.cpp, https://github.com/linuxdeepin/qt5integration) m_frameWindow->setProperty("_d_disable_update_geometry_for_scale", true); window->setParent(m_frameWindow->handle()); window->window()->installEventFilter(this); window->window()->setScreen(m_frameWindow->screen()); window->window()->setProperty("_d_real_winId", window->winId()); window->window()->setProperty(::frameMargins, QVariant::fromValue(m_frameWindow->contentMarginsHint())); #ifdef Q_OS_LINUX if (windowRedirectContent(window->window())) { xcb_composite_redirect_window(window->xcb_connection(), window->xcb_window(), XCB_COMPOSITE_REDIRECT_MANUAL); damage_id = xcb_generate_id(window->xcb_connection()); xcb_damage_create(window->xcb_connection(), damage_id, window->xcb_window(), XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); } #endif updateClipPathByWindowRadius(window->window()->size()); updateClipPathFromProperty(); updateFrameMaskFromProperty(); updateWindowRadiusFromProperty(); updateBorderWidthFromProperty(); updateBorderColorFromProperty(); updateShadowRadiusFromProperty(); updateShadowOffsetFromProperty(); updateShadowColorFromProperty(); updateEnableSystemResizeFromProperty(); updateEnableSystemMoveFromProperty(); updateEnableBlurWindowFromProperty(); updateWindowBlurAreasFromProperty(); updateWindowBlurPathsFromProperty(); updateAutoInputMaskByClipPathFromProperty(); HOOK_VFPTR(setGeometry); HOOK_VFPTR(geometry); HOOK_VFPTR(normalGeometry); HOOK_VFPTR(frameMargins); HOOK_VFPTR(setVisible); HOOK_VFPTR(setWindowFlags); HOOK_VFPTR(setWindowState); HOOK_VFPTR(winId); HOOK_VFPTR(setParent); HOOK_VFPTR(setWindowTitle); HOOK_VFPTR(setWindowFilePath); HOOK_VFPTR(setWindowIcon); HOOK_VFPTR(raise); HOOK_VFPTR(lower); // HOOK_VFPTR(isExposed); HOOK_VFPTR(isEmbedded); HOOK_VFPTR(setOpacity); HOOK_VFPTR(propagateSizeHints); HOOK_VFPTR(requestActivateWindow); // HOOK_VFPTR(setKeyboardGrabEnabled); // HOOK_VFPTR(setMouseGrabEnabled); HOOK_VFPTR(setWindowModified); // HOOK_VFPTR(windowEvent); HOOK_VFPTR(startSystemResize); HOOK_VFPTR(setFrameStrutEventsEnabled); HOOK_VFPTR(frameStrutEventsEnabled); HOOK_VFPTR(setAlertState); HOOK_VFPTR(isAlertState); connect(m_frameWindow, &DFrameWindow::contentMarginsHintChanged, this, &DPlatformWindowHelper::onFrameWindowContentMarginsHintChanged); connect(DWMSupport::instance(), &DXcbWMSupport::hasCompositeChanged, this, &DPlatformWindowHelper::onWMHasCompositeChanged); connect(DWMSupport::instance(), &DXcbWMSupport::windowManagerChanged, this, &DPlatformWindowHelper::updateWindowBlurAreasForWM); // 必须保证两个窗口QScreen对象一致 connect(m_frameWindow, &DFrameWindow::screenChanged, this, &DPlatformWindowHelper::onScreenChanged); connect(window->window(), &QWindow::screenChanged, m_frameWindow, &DFrameWindow::setScreen); connect(m_frameWindow, &DFrameWindow::contentOrientationChanged, window->window(), &QWindow::reportContentOrientationChange); static_cast(window)->propagateSizeHints(); } DPlatformWindowHelper::~DPlatformWindowHelper() { mapped.remove(m_nativeWindow); m_frameWindow->deleteLater(); #ifdef Q_OS_LINUX // clear damage xcb_damage_destroy(DPlatformIntegration::xcbConnection()->xcb_connection(), damage_id); #endif } DPlatformWindowHelper *DPlatformWindowHelper::me() const { return DPlatformWindowHelper::mapped.value(window()); } void DPlatformWindowHelper::setGeometry(const QRect &rect) { DPlatformWindowHelper *helper = me(); qreal device_pixel_ratio = helper->m_frameWindow->devicePixelRatio(); // update clip path helper->updateClipPathByWindowRadius(rect.size() / device_pixel_ratio); const QMargins &content_margins = helper->m_frameWindow->contentMarginsHint() * device_pixel_ratio; qt_window_private(helper->m_frameWindow)->positionAutomatic = qt_window_private(helper->m_nativeWindow->window())->positionAutomatic; helper->m_frameWindow->handle()->setGeometry(rect + content_margins); // NOTE(zccrs): 此处必须要更新内容窗口的大小,因为frame窗口大小改变后可能不会触发resize事件调用updateContentWindowGeometry() // 就会导致内容窗口大小不对,此问题可在文件管理器复制文件对话框重现(多试几次) helper->setNativeWindowGeometry(rect, true); helper->m_nativeWindow->QPlatformWindow::setGeometry(rect); } QRect DPlatformWindowHelper::geometry() const { DPlatformWindowHelper *helper = me(); const QRect &geometry = helper->m_frameWindow->handle()->geometry(); if (geometry.topLeft() == QPoint(0, 0) && geometry.size() == QSize(0, 0)) return geometry; QRect rect = geometry - helper->m_frameWindow->contentMarginsHint() * helper->m_frameWindow->devicePixelRatio(); rect.setSize(helper->m_nativeWindow->QNativeWindow::geometry().size()); return rect; } QRect DPlatformWindowHelper::normalGeometry() const { return me()->m_frameWindow->handle()->normalGeometry(); } QMargins DPlatformWindowHelper::frameMargins() const { return me()->m_frameWindow->handle()->frameMargins(); } QWindow *topvelWindow(QWindow *w) { QWindow *tw = w; while (tw->parent()) tw = tw->parent(); DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(tw->handle()); return helper ? helper->m_frameWindow : tw; } void DPlatformWindowHelper::setVisible(bool visible) { DPlatformWindowHelper *helper = me(); if (visible) { QWindow *tp = helper->m_nativeWindow->window()->transientParent(); helper->m_nativeWindow->window()->setTransientParent(helper->m_frameWindow); if (tp) { QWindow *tw = topvelWindow(tp); if (tw != helper->m_frameWindow) helper->m_frameWindow->setTransientParent(tw); } #ifdef Q_OS_LINUX // reupdate _MOTIF_WM_HINTS DQNativeWindow *window = static_cast(helper->m_frameWindow->handle()); Utility::QtMotifWmHints mwmhints = Utility::getMotifWmHints(window->m_window); if (window->window()->modality() != Qt::NonModal) { switch (window->window()->modality()) { case Qt::WindowModal: mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_PRIMARY_APPLICATION_MODAL; break; case Qt::ApplicationModal: default: mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_FULL_APPLICATION_MODAL; break; } mwmhints.flags |= DXcbWMSupport::MWM_HINTS_INPUT_MODE; } else { mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_MODELESS; mwmhints.flags &= ~DXcbWMSupport::MWM_HINTS_INPUT_MODE; } QWindow *content_window = helper->m_nativeWindow->window(); Utility::QtMotifWmHints cw_hints = Utility::getMotifWmHints(helper->m_nativeWindow->QNativeWindow::winId()); bool size_fixed = content_window->minimumSize() == content_window->maximumSize(); if (size_fixed) { // fixed size, remove the resize handle (since mwm/dtwm // isn't smart enough to do it itself) mwmhints.flags |= DXcbWMSupport::MWM_HINTS_FUNCTIONS; if (mwmhints.functions & DXcbWMSupport::MWM_FUNC_ALL) { mwmhints.functions = DXcbWMSupport::MWM_FUNC_MOVE; } else { mwmhints.functions &= ~DXcbWMSupport::MWM_FUNC_RESIZE; } if (mwmhints.decorations & DXcbWMSupport::MWM_DECOR_ALL) { mwmhints.flags |= DXcbWMSupport::MWM_HINTS_DECORATIONS; mwmhints.decorations = (DXcbWMSupport::MWM_DECOR_BORDER | DXcbWMSupport::MWM_DECOR_TITLE | DXcbWMSupport::MWM_DECOR_MENU); } else { mwmhints.decorations &= ~DXcbWMSupport::MWM_DECOR_RESIZEH; } // set content window decoration hints cw_hints.flags |= DXcbWMSupport::MWM_HINTS_DECORATIONS; cw_hints.decorations = DXcbWMSupport::MWM_DECOR_MINIMIZE; } if (content_window->flags() & Qt::WindowMinimizeButtonHint) { mwmhints.functions |= DXcbWMSupport::MWM_FUNC_MINIMIZE; cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_MINIMIZE; } if (content_window->flags() & Qt::WindowMaximizeButtonHint) { mwmhints.functions |= DXcbWMSupport::MWM_FUNC_MAXIMIZE; if (!size_fixed) cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_MAXIMIZE; } if (content_window->flags() & Qt::WindowCloseButtonHint) { mwmhints.functions |= DXcbWMSupport::MWM_FUNC_CLOSE; } if (content_window->flags() & Qt::WindowTitleHint) { cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_TITLE; } if (content_window->flags() & Qt::WindowSystemMenuHint) { cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_MENU; } #endif helper->m_frameWindow->setVisible(visible); helper->updateContentWindowGeometry(); helper->m_nativeWindow->QNativeWindow::setVisible(visible); helper->updateWindowBlurAreasForWM(); // restore if (tp) { helper->m_nativeWindow->window()->setTransientParent(tp); } #ifdef Q_OS_LINUX else { xcb_delete_property(window->xcb_connection(), window->m_window, XCB_ATOM_WM_TRANSIENT_FOR); } // Fix the window can't show minimized if window is fixed size Utility::setMotifWmHints(window->m_window, mwmhints); Utility::setMotifWmHints(helper->m_nativeWindow->QNativeWindow::winId(), cw_hints); if (helper->m_nativeWindow->window()->modality() != Qt::NonModal) { #if QT_VERSION < QT_VERSION_CHECK(5, 12, 1) window->setNetWmStates(window->netWmStates() | QNativeWindow::NetWmStateModal); #else window->setNetWmState(true, window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_STATE_MODAL))); #endif } #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) // 当Qt版本在5.9及以上时, 如果窗口设置了BypassWindowManagerHint标志, 窗口就无法通过鼠标点击获得焦点 if (helper->m_nativeWindow->window()->flags().testFlag(Qt::BypassWindowManagerHint) && QGuiApplication::modalWindow() == helper->m_nativeWindow->window()) { helper->m_nativeWindow->requestActivateWindow(); } #endif return; } helper->m_frameWindow->setVisible(visible); helper->m_nativeWindow->QNativeWindow::setVisible(visible); helper->updateWindowBlurAreasForWM(); } void DPlatformWindowHelper::setWindowFlags(Qt::WindowFlags flags) { me()->m_frameWindow->setFlags((flags | Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::NoDropShadowWindowHint) & ~Qt::WindowMinMaxButtonsHint); window()->QNativeWindow::setWindowFlags(flags); } #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) void DPlatformWindowHelper::setWindowState(Qt::WindowState state) #else void DPlatformWindowHelper::setWindowState(Qt::WindowStates state) #endif { #ifdef Q_OS_LINUX DQNativeWindow *window = static_cast(me()->m_frameWindow->handle()); if (window->m_windowState == state) return; if (state == Qt::WindowMinimized && (window->m_windowState == Qt::WindowMaximized || window->m_windowState == Qt::WindowFullScreen)) { #if QT_VERSION < QT_VERSION_CHECK(5, 12, 1) window->changeNetWmState(true, Utility::internAtom("_NET_WM_STATE_HIDDEN")); #else window->setNetWmState(true, Utility::internAtom("_NET_WM_STATE_HIDDEN")); #endif Utility::XIconifyWindow(window->connection()->xlib_display(), window->m_window, window->connection()->primaryScreenNumber()); window->connection()->sync(); window->m_windowState = state; } else #endif { #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) me()->m_frameWindow->setWindowState(state); #else me()->m_frameWindow->setWindowStates(state); #endif } } WId DPlatformWindowHelper::winId() const { return me()->m_frameWindow->handle()->winId(); } void DPlatformWindowHelper::setParent(const QPlatformWindow *window) { me()->m_frameWindow->handle()->setParent(window); } void DPlatformWindowHelper::setWindowTitle(const QString &title) { me()->m_frameWindow->handle()->setWindowTitle(title); } void DPlatformWindowHelper::setWindowFilePath(const QString &title) { me()->m_frameWindow->handle()->setWindowFilePath(title); } void DPlatformWindowHelper::setWindowIcon(const QIcon &icon) { me()->m_frameWindow->handle()->setWindowIcon(icon); } void DPlatformWindowHelper::raise() { me()->m_frameWindow->handle()->raise(); } void DPlatformWindowHelper::lower() { me()->m_frameWindow->handle()->lower(); } bool DPlatformWindowHelper::isExposed() const { return me()->m_frameWindow->handle()->isExposed(); } #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) bool DPlatformWindowHelper::isEmbedded() const { return me()->m_frameWindow->handle()->isEmbedded(); } #else bool DPlatformWindowHelper::isEmbedded(const QPlatformWindow *parentWindow) const { return me()->m_frameWindow->handle()->isEmbedded(parentWindow); } #endif void DPlatformWindowHelper::propagateSizeHints() { me()->updateSizeHints(); const QWindow *window = this->window()->window(); if (window->maximumSize() == window->minimumSize()) { Utility::QtMotifWmHints cw_hints = Utility::getMotifWmHints(this->window()->QNativeWindow::winId()); cw_hints.flags |= DXcbWMSupport::MWM_HINTS_DECORATIONS; cw_hints.decorations = DXcbWMSupport::MWM_DECOR_MINIMIZE; if (window->flags() & Qt::WindowTitleHint) { cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_TITLE; } if (window->flags() & Qt::WindowSystemMenuHint) { cw_hints.decorations |= DXcbWMSupport::MWM_DECOR_MENU; } Utility::setMotifWmHints(this->window()->QNativeWindow::winId(), cw_hints); } } void DPlatformWindowHelper::setOpacity(qreal level) { me()->m_frameWindow->setOpacity(level); } void DPlatformWindowHelper::requestActivateWindow() { DPlatformWindowHelper *helper = me(); #ifdef Q_OS_LINUX // 窗口管理器不支持混成时,最小化窗口会导致窗口被unmap if (!DXcbWMSupport::instance()->hasComposite() && helper->m_frameWindow->windowState() == Qt::WindowMinimized) { #ifdef Q_XCB_CALL Q_XCB_CALL(xcb_map_window(DPlatformIntegration::xcbConnection()->xcb_connection(), helper->m_frameWindow->winId())); #else xcb_map_window(DPlatformIntegration::xcbConnection()->xcb_connection(), helper->m_frameWindow->winId()); #endif } #endif helper->m_frameWindow->handle()->requestActivateWindow(); #ifdef Q_OS_LINUX // 对于有parent的窗口,需要调用此接口让其获得输入焦点 xcb_set_input_focus(DPlatformIntegration::xcbConnection()->xcb_connection(), XCB_INPUT_FOCUS_PARENT, helper->m_nativeWindow->QNativeWindow::winId(), DPlatformIntegration::xcbConnection()->time()); #endif } bool DPlatformWindowHelper::setKeyboardGrabEnabled(bool grab) { return me()->m_frameWindow->handle()->setKeyboardGrabEnabled(grab); } bool DPlatformWindowHelper::setMouseGrabEnabled(bool grab) { return me()->m_frameWindow->handle()->setMouseGrabEnabled(grab); } bool DPlatformWindowHelper::setWindowModified(bool modified) { return me()->m_frameWindow->handle()->setWindowModified(modified); } #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) bool DPlatformWindowHelper::startSystemResize(const QPoint &pos, Qt::Corner corner) { return me()->m_frameWindow->handle()->startSystemResize(pos, corner); } #else bool DPlatformWindowHelper::startSystemResize(Qt::Edges edges) { return me()->m_frameWindow->handle()->startSystemResize(edges); } #endif void DPlatformWindowHelper::setFrameStrutEventsEnabled(bool enabled) { me()->m_frameWindow->handle()->setFrameStrutEventsEnabled(enabled); } bool DPlatformWindowHelper::frameStrutEventsEnabled() const { return me()->m_frameWindow->handle()->frameStrutEventsEnabled(); } void DPlatformWindowHelper::setAlertState(bool enabled) { me()->m_frameWindow->handle()->setAlertState(enabled); } bool DPlatformWindowHelper::isAlertState() const { return me()->m_frameWindow->handle()->isAlertState(); } bool DPlatformWindowHelper::windowRedirectContent(QWindow *window) { // 环境变量的值最优先 static const QByteArray env = qgetenv("DXCB_REDIRECT_CONTENT"); if (env == "true") { return true; } else if (env == "false") { return false; } // 判断在2D模式下是否允许重定向窗口绘制的内容,此环境变量默认不设置,因此默认需要禁用2D下的重定向 // 修复dde-dock在某些2D环境(如HW云桌面)中不显示窗口内容 if (!DXcbWMSupport::instance()->hasComposite() && qEnvironmentVariableIsEmpty("DXCB_REDIRECT_CONTENT_WITH_NO_COMPOSITE")) { return false; } const QVariant &value = window->property(redirectContent); if (value.type() == QVariant::Bool) return value.toBool(); return window->surfaceType() == QSurface::OpenGLSurface; } bool DPlatformWindowHelper::eventFilter(QObject *watched, QEvent *event) { if (watched == m_frameWindow) { switch ((int)event->type()) { case QEvent::Close: m_nativeWindow->window()->close(); return true; case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::WindowDeactivate: QCoreApplication::sendEvent(m_nativeWindow->window(), event); return true; case QEvent::Move: { QRect geometry = m_frameWindow->handle()->geometry(); if (geometry.topLeft() != QPoint(0, 0) || geometry.size() != QSize(0, 0)) { geometry.translate(-m_frameWindow->contentOffsetHint()); geometry.setSize(m_nativeWindow->QNativeWindow::geometry().size()); } m_nativeWindow->QPlatformWindow::setGeometry(geometry); QWindowSystemInterface::handleGeometryChange(m_nativeWindow->window(), geometry); return true; } case QEvent::FocusIn: #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) QWindowSystemInterface::handleWindowActivated(m_nativeWindow->window(), static_cast(event)->reason()); #else QWindowSystemInterface::handleFocusWindowChanged(m_nativeWindow->window(), static_cast(event)->reason()); #endif return true; case QEvent::WindowActivate: #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) QWindowSystemInterface::handleWindowActivated(m_nativeWindow->window(), Qt::OtherFocusReason); #else QWindowSystemInterface::handleFocusWindowChanged(m_nativeWindow->window(), Qt::OtherFocusReason); #endif return true; case QEvent::Resize: { updateContentWindowGeometry(); break; } case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseMove: { DQMouseEvent *e = static_cast(event); const QRectF rectF(m_windowValidGeometry); const QPointF posF(e->localPos() - m_frameWindow->contentOffsetHint()); // QRectF::contains中判断时加入了右下边界 if (!qFuzzyCompare(posF.x(), rectF.width()) && !qFuzzyCompare(posF.y(), rectF.height()) && rectF.contains(posF)) { m_frameWindow->unsetCursor(); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) e->l = e->w = m_nativeWindow->window()->mapFromGlobal(e->globalPos()); qApp->sendEvent(m_nativeWindow->window(), e); #elif QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) QScopedPointer mevent(QMutableSinglePointEvent::from(e->clone())); mevent->mutablePoint().setPosition(m_nativeWindow->window()->mapFromGlobal(e->globalPosition())); mevent->mutablePoint().setScenePosition(m_nativeWindow->window()->mapFromGlobal(e->globalPosition())); qApp->sendEvent(m_nativeWindow->window(), mevent.data()); #else QScopedPointer mevent(QMutableSinglePointEvent::from(e->clone())); QMutableEventPoint::setPosition(mevent->point(0), m_nativeWindow->window()->mapFromGlobal(e->globalPosition())); QMutableEventPoint::setScenePosition(mevent->point(0), m_nativeWindow->window()->mapFromGlobal(e->globalPosition())); qApp->sendEvent(m_nativeWindow->window(), mevent.data()); #endif return true; } break; } case QEvent::WindowStateChange: { #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) Qt::WindowState old_state = qt_window_private(m_nativeWindow->window())->windowState; Qt::WindowState new_state = m_frameWindow->windowState(); #else Qt::WindowStates old_state = qt_window_private(m_nativeWindow->window())->windowState; Qt::WindowStates new_state = m_frameWindow->windowState(); #endif qt_window_private(m_nativeWindow->window())->windowState = new_state; QCoreApplication::sendEvent(m_nativeWindow->window(), event); updateClipPathByWindowRadius(m_nativeWindow->window()->size()); // need repaint content window if ((old_state == Qt::WindowFullScreen || old_state == Qt::WindowMaximized) && new_state == Qt::WindowNoState) { if (m_frameWindow->m_paintShadowOnContentTimerId < 0 && m_frameWindow->m_contentBackingStore) { m_frameWindow->m_paintShadowOnContentTimerId = m_frameWindow->startTimer(0, Qt::PreciseTimer); } } break; } case QEvent::DragEnter: case QEvent::DragMove: case QEvent::Drop: { DQDropEvent *e = static_cast(event); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) e->m_pos -= m_frameWindow->contentOffsetHint(); #else e->p -= m_frameWindow->contentOffsetHint(); #endif #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) Q_FALLTHROUGH(); #endif } // deliberate case QEvent::DragLeave: QCoreApplication::sendEvent(m_nativeWindow->window(), event); return true; case QEvent::PlatformSurface: { const QPlatformSurfaceEvent *e = static_cast(event); if (e->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) m_nativeWindow->window()->destroy(); break; } case QEvent::Expose: { // ###(zccrs): 在频繁切换窗口管理器时,可能会出现frame窗口被外部(可能是窗管)调用map // 但是content窗口还是隐藏状态,所以在此做状态检查和同步 if (m_frameWindow->handle()->isExposed() && !m_nativeWindow->isExposed()) { m_nativeWindow->setVisible(true); } } default: break; } } else if (watched == m_nativeWindow->window()) { switch ((int)event->type()) { case QEvent::MouseMove: { if (qApp->mouseButtons() != Qt::LeftButton) break; static QEvent *last_event = NULL; if (last_event == event) { last_event = NULL; return false; } last_event = event; QCoreApplication::sendEvent(watched, event); if (!event->isAccepted()) { DQMouseEvent *e = static_cast(event); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) e->l = e->w = m_frameWindow->mapFromGlobal(e->globalPos()); QGuiApplicationPrivate::setMouseEventSource(e, Qt::MouseEventSynthesizedByQt); m_frameWindow->mouseMoveEvent(e); #elif QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) QScopedPointer mevent(QMutableSinglePointEvent::from(e->clone())); mevent->mutablePoint().setPosition(m_frameWindow->mapFromGlobal(e->globalPosition())); mevent->mutablePoint().setScenePosition(m_frameWindow->mapFromGlobal(e->globalPosition())); qApp->sendEvent(m_frameWindow, mevent.data()); #else QScopedPointer mevent(QMutableSinglePointEvent::from(e->clone())); QMutableEventPoint::setPosition(mevent->point(0), m_frameWindow->mapFromGlobal(e->globalPosition())); QMutableEventPoint::setScenePosition(mevent->point(0), m_frameWindow->mapFromGlobal(e->globalPosition())); qApp->sendEvent(m_frameWindow, mevent.data()); #endif return true; } break; } #if QT_VERSION > QT_VERSION_CHECK(5, 6, 1) // NOTE(zccrs): https://codereview.qt-project.org/#/c/162027/ (QTBUG-53993) case QEvent::MouseButtonPress: { QWindow *w = m_nativeWindow->window(); if (w->flags().testFlag(Qt::BypassWindowManagerHint)) { const QMouseEvent *me = static_cast(event); if (me->button() == Qt::LeftButton && w != QGuiApplication::focusWindow()) { if (!(w->flags() & (Qt::WindowDoesNotAcceptFocus)) && w->type() != Qt::ToolTip && w->type() != Qt::Popup) { w->requestActivate(); } } } break; } #endif case QEvent::MouseButtonRelease: { if (m_frameWindow->m_isSystemMoveResizeState) { Utility::cancelWindowMoveResize(Utility::getNativeTopLevelWindow(m_frameWindow->winId())); m_frameWindow->m_isSystemMoveResizeState = false; } break; } case QEvent::PlatformSurface: { const QPlatformSurfaceEvent *e = static_cast(event); if (e->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) m_frameWindow->create(); break; } case QEvent::Resize: if (m_isUserSetClipPath) { // 窗口大小改变时要强制更新模糊区域,所以需要将第二个参数传递为true setWindowValidGeometry(m_clipPath.boundingRect().toRect() & QRect(QPoint(0, 0), static_cast(event)->size()), true); } else { updateClipPathByWindowRadius(static_cast(event)->size()); } break; // ###(zccrs): 在9b1a28e6这个提交中因为调用了内部窗口的setVisible,所以需要过滤掉visible为false时产生的不必要的Leave事件 // 这段代码会引起窗口被其它窗口覆盖时的Leave事件丢失 // 因为已经移除了setVisible相关的代码,故先注释掉这部分代码,看是否有不良影响 // case QEvent::Leave: { // QWindow::Visibility visibility = m_nativeWindow->window()->visibility(); // if (visibility == QWindow::Hidden || visibility == QWindow::Minimized || !m_nativeWindow->window()->isActive()) // break; // const QPoint &pos = Utility::translateCoordinates(QPoint(0, 0), m_nativeWindow->winId(), // DPlatformIntegration::instance()->defaultConnection()->rootWindow()); // const QPoint &cursor_pos = qApp->primaryScreen()->handle()->cursor()->pos(); // return m_clipPath.contains(QPointF(cursor_pos - pos) / m_nativeWindow->window()->devicePixelRatio()); // } #ifdef Q_OS_LINUX case QEvent::Wheel: { // ###(zccrs): Qt的bug,QWidgetWindow往QWidget中转发QWheelEvent时没有调用setTimestamp // 暂时使用这种低等的方案绕过此问题 DQWheelEvent *ev = static_cast(event); const DeviceType type = DPlatformIntegration::instance()->eventFilter()->xiEventSource(ev); if (type != UnknowDevice) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) ev->m_mouseState |= Qt::MaxMouseButton | Qt::MouseButton(type); #else ev->mouseState |= Qt::MaxMouseButton | Qt::MouseButton(type); #endif break; } #endif default: break; } } return false; } void DPlatformWindowHelper::setNativeWindowGeometry(const QRect &rect, bool onlyResize) { qt_window_private(m_nativeWindow->window())->parentWindow = m_frameWindow; qt_window_private(m_nativeWindow->window())->positionAutomatic = onlyResize; // 对于非顶层窗口,Qt会根据新的geometry获取窗口所在屏幕,并将屏幕设置给此窗口 // 因此此处设置native window对于的parent window,避免它被判断为顶层窗口。 // note: 有父窗口的窗口则会使用父窗口的screen对象。 QWindowPrivate::get(m_nativeWindow->window())->parentWindow = m_frameWindow; m_nativeWindow->QNativeWindow::setGeometry(rect); QWindowPrivate::get(m_nativeWindow->window())->parentWindow = nullptr; qt_window_private(m_nativeWindow->window())->parentWindow = 0; qt_window_private(m_nativeWindow->window())->positionAutomatic = false; updateWindowNormalHints(); } void DPlatformWindowHelper::updateClipPathByWindowRadius(const QSize &windowSize) { if (!m_isUserSetClipPath) { // 第二个参数传递true,强制更新模糊区域 setWindowValidGeometry(QRect(QPoint(0, 0), windowSize), true); int window_radius = getWindowRadius(); QPainterPath path; path.addRoundedRect(m_windowValidGeometry, window_radius, window_radius); setClipPath(path); } } void DPlatformWindowHelper::setClipPath(const QPainterPath &path) { if (m_clipPath == path) return; m_clipPath = path; if (m_isUserSetClipPath) { setWindowValidGeometry(m_clipPath.boundingRect().toRect() & QRect(QPoint(0, 0), m_nativeWindow->window()->size())); } updateWindowShape(); updateWindowBlurAreasForWM(); updateContentPathForFrameWindow(); } void DPlatformWindowHelper::setWindowValidGeometry(const QRect &geometry, bool force) { if (!force && geometry == m_windowValidGeometry) return; m_windowValidGeometry = geometry; // The native window geometry may not update now, we need to wait for resize // event to proceed. QTimer::singleShot(0, this, &DPlatformWindowHelper::updateWindowBlurAreasForWM); } bool DPlatformWindowHelper::updateWindowBlurAreasForWM() { // NOTE(zccrs): 当窗口unmap时清理模糊区域的属性,否则可能会导致窗口已经隐藏,但模糊区域没有消失的问题。因为窗口管理器不是绝对根据窗口是否map来绘制 // 模糊背景,当窗口unmap但是窗口的WM State值为Normal时也会绘制模糊背景(这种情况可能出现在连续多次快速切换窗口管理器时) if (!m_nativeWindow->window()->isVisible() || (!m_enableBlurWindow && m_blurAreaList.isEmpty() && m_blurPathList.isEmpty())) { Utility::clearWindowBlur(m_frameWindow->winId()); return true; } qreal device_pixel_ratio = m_nativeWindow->window()->devicePixelRatio(); const QRect &windowValidRect = m_windowValidGeometry * device_pixel_ratio; if (windowValidRect.isEmpty() || !m_nativeWindow->window()->isVisible()) return false; quint32 top_level_w = Utility::getNativeTopLevelWindow(m_frameWindow->winId()); QPoint offset = m_frameWindow->contentOffsetHint() * device_pixel_ratio; if (top_level_w != m_frameWindow->winId()) { offset += Utility::translateCoordinates(QPoint(0, 0), m_frameWindow->winId(), top_level_w); } QVector newAreas; if (m_enableBlurWindow) { if (m_isUserSetClipPath) { QList list; list << (m_clipPath * device_pixel_ratio).translated(offset); return Utility::blurWindowBackgroundByPaths(top_level_w, list); } Utility::BlurArea area; area.x = windowValidRect.x() + offset.x(); area.y = windowValidRect.y() + offset.y(); area.width = windowValidRect.width(); area.height = windowValidRect.height(); area.xRadius = getWindowRadius() * device_pixel_ratio; area.yRaduis = getWindowRadius() * device_pixel_ratio; newAreas.append(std::move(area)); return Utility::blurWindowBackground(top_level_w, newAreas); } QPainterPath window_valid_path; window_valid_path.addRect(QRect(offset, m_nativeWindow->QPlatformWindow::geometry().size())); window_valid_path &= (m_clipPath * device_pixel_ratio).translated(offset); if (m_blurPathList.isEmpty()) { if (m_blurAreaList.isEmpty()) return true; newAreas.reserve(m_blurAreaList.size()); foreach (Utility::BlurArea area, m_blurAreaList) { area *= device_pixel_ratio; area.x += offset.x(); area.y += offset.y(); QPainterPath path; path.addRoundedRect(area.x, area.y, area.width, area.height, area.xRadius, area.yRaduis); if (!window_valid_path.contains(path)) { const QPainterPath valid_blur_path = window_valid_path & path; const QRectF valid_blur_rect = valid_blur_path.boundingRect(); if (path.boundingRect() != valid_blur_rect) { area.x = valid_blur_rect.x(); area.y = valid_blur_rect.y(); area.width = valid_blur_rect.width(); area.height = valid_blur_rect.height(); path = QPainterPath(); path.addRoundedRect(valid_blur_rect.x(), valid_blur_rect.y(), valid_blur_rect.width(), valid_blur_rect.height(), area.xRadius, area.yRaduis); if (valid_blur_path != path) { break; } } else if (valid_blur_path != path) { break; } } newAreas.append(std::move(area)); } if (newAreas.size() == m_blurAreaList.size()) return Utility::blurWindowBackground(top_level_w, newAreas); } QList newPathList; newPathList.reserve(m_blurAreaList.size()); foreach (Utility::BlurArea area, m_blurAreaList) { QPainterPath path; area *= device_pixel_ratio; path.addRoundedRect(area.x + offset.x(), area.y + offset.y(), area.width, area.height, area.xRadius, area.yRaduis); path = path.intersected(window_valid_path); if (!path.isEmpty()) newPathList << path; } if (!m_blurPathList.isEmpty()) { newPathList.reserve(newPathList.size() + m_blurPathList.size()); foreach (const QPainterPath &path, m_blurPathList) { newPathList << (path * device_pixel_ratio).translated(offset).intersected(window_valid_path); } } if (newPathList.isEmpty()) return true; return Utility::blurWindowBackgroundByPaths(top_level_w, newPathList); } void DPlatformWindowHelper::updateSizeHints() { const QMargins &content_margins = m_frameWindow->contentMarginsHint(); const QSize extra_size(content_margins.left() + content_margins.right(), content_margins.top() + content_margins.bottom()); qt_window_private(m_frameWindow)->minimumSize = m_nativeWindow->window()->minimumSize() + extra_size; qt_window_private(m_frameWindow)->maximumSize = m_nativeWindow->window()->maximumSize() + extra_size; qt_window_private(m_frameWindow)->baseSize = m_nativeWindow->window()->baseSize() + extra_size; qt_window_private(m_frameWindow)->sizeIncrement = m_nativeWindow->window()->sizeIncrement(); m_frameWindow->handle()->propagateSizeHints(); updateWindowNormalHints(); } void DPlatformWindowHelper::updateContentPathForFrameWindow() { if (m_isUserSetClipPath) { m_frameWindow->setContentPath(m_clipPath); } else { m_frameWindow->setContentRoundedRect(m_windowValidGeometry, getWindowRadius()); } } void DPlatformWindowHelper::updateContentWindowGeometry() { const auto windowRatio = m_nativeWindow->window()->devicePixelRatio(); const auto &contentMargins = m_frameWindow->contentMarginsHint(); const auto &contentPlatformMargins = contentMargins * windowRatio; const QSize &size = m_frameWindow->handle()->geometry().marginsRemoved(contentPlatformMargins).size(); // update the content window geometry setNativeWindowGeometry(QRect(contentPlatformMargins.left(), contentPlatformMargins.top(), size.width(), size.height())); } #ifdef Q_OS_LINUX void DPlatformWindowHelper::updateWindowNormalHints() { // update WM_NORMAL_HINTS xcb_size_hints_t hints; memset(&hints, 0, sizeof(hints)); xcb_icccm_size_hints_set_resize_inc(&hints, 1, 1); xcb_icccm_set_wm_normal_hints(m_nativeWindow->xcb_connection(), m_nativeWindow->xcb_window(), &hints); QSize size_inc = m_frameWindow->sizeIncrement(); if (size_inc.isEmpty()) size_inc = QSize(1, 1); xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_normal_hints(m_nativeWindow->xcb_connection(), m_frameWindow->winId()); if (xcb_get_property_reply_t *reply = xcb_get_property_reply(m_nativeWindow->xcb_connection(), cookie, 0)) { xcb_icccm_get_wm_size_hints_from_reply(&hints, reply); free(reply); if (hints.width_inc == 1 && hints.height_inc == 1) { return; } } else { return; } xcb_icccm_size_hints_set_resize_inc(&hints, size_inc.width(), size_inc.height()); xcb_icccm_set_wm_normal_hints(m_nativeWindow->xcb_connection(), m_frameWindow->winId(), &hints); } void DPlatformWindowHelper::updateWindowShape() { const QPainterPath &real_path = m_clipPath * m_nativeWindow->window()->devicePixelRatio(); QPainterPathStroker stroker; stroker.setJoinStyle(Qt::MiterJoin); stroker.setWidth(4 * m_nativeWindow->window()->devicePixelRatio()); Utility::setShapePath(m_nativeWindow->QNativeWindow::winId(), stroker.createStroke(real_path).united(real_path), m_frameWindow->m_redirectContent || !m_isUserSetClipPath, m_nativeWindow->window()->flags().testFlag(Qt::WindowTransparentForInput)); } #endif int DPlatformWindowHelper::getWindowRadius() const { //#ifdef Q_OS_LINUX // QNativeWindow::NetWmStates states = static_cast(m_frameWindow->handle())->netWmStates(); // if (states.testFlag(QNativeWindow::NetWmStateFullScreen) // || states.testFlag(QNativeWindow::NetWmState(QNativeWindow::NetWmStateMaximizedHorz // | QNativeWindow::NetWmStateMaximizedVert))) { // return 0; // } //#else if (m_frameWindow->windowState() == Qt::WindowFullScreen || m_frameWindow->windowState() == Qt::WindowMaximized) return 0; //#endif return (m_isUserSetWindowRadius || DWMSupport::instance()->hasWindowAlpha()) ? m_windowRadius : 0; } int DPlatformWindowHelper::getShadowRadius() const { return DWMSupport::instance()->hasWindowAlpha() ? m_shadowRadius : 0; } int DPlatformWindowHelper::getBorderWidth() const { if (m_isUserSetBorderWidth || DWMSupport::instance()->hasWindowAlpha()) return m_borderWidth; return m_frameWindow->canResize() ? 2 : m_borderWidth; } static QColor colorBlend(const QColor &color1, const QColor &color2) { QColor c2 = color2.toRgb(); if (c2.alpha() >= 255) return c2; QColor c1 = color1.toRgb(); qreal c1_weight = 1 - c2.alphaF(); int r = c1_weight * c1.red() + c2.alphaF() * c2.red(); int g = c1_weight * c1.green() + c2.alphaF() * c2.green(); int b = c1_weight * c1.blue() + c2.alphaF() * c2.blue(); return QColor(r, g, b); } QColor DPlatformWindowHelper::getBorderColor() const { return DWMSupport::instance()->hasWindowAlpha() ? m_borderColor : colorBlend(QColor("#e0e0e0"), m_borderColor); } void DPlatformWindowHelper::updateWindowRadiusFromProperty() { const QVariant &v = m_nativeWindow->window()->property(windowRadius); if (!v.isValid()) { m_nativeWindow->window()->setProperty(windowRadius, getWindowRadius()); return; } bool ok; int radius = v.toInt(&ok); if (ok && radius != m_windowRadius) { m_windowRadius = radius; m_isUserSetWindowRadius = true; m_isUserSetClipPath = false; updateClipPathByWindowRadius(m_nativeWindow->window()->size()); } } void DPlatformWindowHelper::updateBorderWidthFromProperty() { const QVariant &v = m_nativeWindow->window()->property(borderWidth); if (!v.isValid()) { m_nativeWindow->window()->setProperty(borderWidth, getBorderWidth()); return; } bool ok; int width = v.toInt(&ok); if (ok && width != m_borderWidth) { m_borderWidth = width; m_isUserSetBorderWidth = true; m_frameWindow->setBorderWidth(width); } } void DPlatformWindowHelper::updateBorderColorFromProperty() { const QVariant &v = m_nativeWindow->window()->property(borderColor); if (!v.isValid()) { m_nativeWindow->window()->setProperty(borderColor, m_borderColor); return; } const QColor &color = qvariant_cast(v); if (color.isValid() && m_borderColor != color) { m_borderColor = color; m_frameWindow->setBorderColor(getBorderColor()); } } void DPlatformWindowHelper::updateShadowRadiusFromProperty() { const QVariant &v = m_nativeWindow->window()->property(shadowRadius); if (!v.isValid()) { m_nativeWindow->window()->setProperty(shadowRadius, m_shadowRadius); return; } bool ok; int radius = qMax(v.toInt(&ok), 0); if (ok && radius != m_shadowRadius) { m_shadowRadius = radius; if (DWMSupport::instance()->hasWindowAlpha()) m_frameWindow->setShadowRadius(radius); } } void DPlatformWindowHelper::updateShadowOffsetFromProperty() { const QVariant &v = m_nativeWindow->window()->property(shadowOffset); if (!v.isValid()) { m_nativeWindow->window()->setProperty(shadowOffset, m_shadowOffset); return; } const QPoint &offset = v.toPoint(); if (offset != m_shadowOffset) { m_shadowOffset = offset; m_frameWindow->setShadowOffset(offset); } } void DPlatformWindowHelper::updateShadowColorFromProperty() { const QVariant &v = m_nativeWindow->window()->property(shadowColor); if (!v.isValid()) { m_nativeWindow->window()->setProperty(shadowColor, m_shadowColor); return; } const QColor &color = qvariant_cast(v); if (color.isValid() && m_shadowColor != color) { m_shadowColor = color; m_frameWindow->setShadowColor(color); } } void DPlatformWindowHelper::updateEnableSystemResizeFromProperty() { const QVariant &v = m_nativeWindow->window()->property(enableSystemResize); if (!v.isValid()) { m_nativeWindow->window()->setProperty(enableSystemResize, m_enableSystemResize); return; } if (m_enableSystemResize == v.toBool()) return; m_enableSystemResize = v.toBool(); m_frameWindow->setEnableSystemResize(m_enableSystemResize); } void DPlatformWindowHelper::updateEnableSystemMoveFromProperty() { const QVariant &v = m_nativeWindow->window()->property(enableSystemMove); if (!v.isValid()) { m_nativeWindow->window()->setProperty(enableSystemMove, m_enableSystemMove); return; } m_enableSystemMove = v.toBool(); m_frameWindow->setEnableSystemMove(m_enableSystemMove); } void DPlatformWindowHelper::updateEnableBlurWindowFromProperty() { const QVariant &v = m_nativeWindow->window()->property(enableBlurWindow); if (!v.isValid()) { m_nativeWindow->window()->setProperty(enableBlurWindow, m_enableBlurWindow); return; } if (m_enableBlurWindow != v.toBool()) { m_enableBlurWindow = v.toBool(); if (m_enableBlurWindow) { QObject::connect(DWMSupport::instance(), &DWMSupport::windowManagerChanged, this, &DPlatformWindowHelper::updateWindowBlurAreasForWM); } else { QObject::disconnect(DWMSupport::instance(), &DWMSupport::windowManagerChanged, this, &DPlatformWindowHelper::updateWindowBlurAreasForWM); } updateWindowBlurAreasForWM(); } } void DPlatformWindowHelper::updateWindowBlurAreasFromProperty() { const QVariant &v = m_nativeWindow->window()->property(windowBlurAreas); const QVector &tmpV = qvariant_cast>(v); const QVector &a = *(reinterpret_cast*>(&tmpV)); if (a.isEmpty() && m_blurAreaList.isEmpty()) return; m_blurAreaList = a; updateWindowBlurAreasForWM(); } void DPlatformWindowHelper::updateWindowBlurPathsFromProperty() { const QVariant &v = m_nativeWindow->window()->property(windowBlurPaths); const QList paths = qvariant_cast>(v); if (paths.isEmpty() && m_blurPathList.isEmpty()) return; m_blurPathList = paths; updateWindowBlurAreasForWM(); } void DPlatformWindowHelper::updateAutoInputMaskByClipPathFromProperty() { const QVariant &v = m_nativeWindow->window()->property(autoInputMaskByClipPath); if (!v.isValid()) { m_nativeWindow->window()->setProperty(autoInputMaskByClipPath, m_autoInputMaskByClipPath); return; } if (m_autoInputMaskByClipPath != v.toBool()) { m_autoInputMaskByClipPath = v.toBool(); } m_frameWindow->m_enableAutoInputMaskByContentPath = m_autoInputMaskByClipPath; } void DPlatformWindowHelper::setWindowProperty(QWindow *window, const char *name, const QVariant &value) { const QVariant &old_value = window->property(name); if (old_value == value) return; if (value.typeName() == QByteArray("QPainterPath")) { const QPainterPath &old_path = qvariant_cast(old_value); const QPainterPath &new_path = qvariant_cast(value); if (old_path == new_path) { return; } } window->setProperty(name, value); if (!mapped.value(window->handle())) return; QByteArray name_array(name); if (!name_array.startsWith("_d_")) return; // to upper name_array[3] = name_array.at(3) & ~0x20; const QByteArray slot_name = "update" + name_array.mid(3) + "FromProperty"; if (!QMetaObject::invokeMethod(mapped.value(window->handle()), slot_name.constData(), Qt::DirectConnection)) { qWarning() << "Failed to update property:" << slot_name; } } void DPlatformWindowHelper::onFrameWindowContentMarginsHintChanged(const QMargins &oldMargins) { updateWindowBlurAreasForWM(); updateSizeHints(); const QMargins &contentMargins = m_frameWindow->contentMarginsHint(); m_nativeWindow->window()->setProperty(::frameMargins, QVariant::fromValue(contentMargins)); m_frameWindow->setGeometry(m_frameWindow->geometry() + contentMargins - oldMargins); updateContentWindowGeometry(); } void DPlatformWindowHelper::onWMHasCompositeChanged() { const QSize &window_size = m_nativeWindow->window()->size(); updateClipPathByWindowRadius(window_size); if (!DXcbWMSupport::instance()->hasWindowAlpha()) m_frameWindow->disableRepaintShadow(); m_frameWindow->setShadowRadius(getShadowRadius()); m_frameWindow->enableRepaintShadow(); // QPainterPath clip_path = m_clipPath * m_nativeWindow->window()->devicePixelRatio(); // if (DXcbWMSupport::instance()->hasWindowAlpha()) { // QPainterPathStroker stroker; // stroker.setJoinStyle(Qt::MiterJoin); // stroker.setWidth(1); // clip_path = stroker.createStroke(clip_path).united(clip_path); // } m_frameWindow->updateMask(); m_frameWindow->setBorderWidth(getBorderWidth()); m_frameWindow->setBorderColor(getBorderColor()); if (m_nativeWindow->window()->inherits("QWidgetWindow")) { QEvent event(QEvent::UpdateRequest); qApp->sendEvent(m_nativeWindow->window(), &event); } else { QMetaObject::invokeMethod(m_nativeWindow->window(), "update"); } } void DPlatformWindowHelper::onDevicePixelRatioChanged() { updateWindowShape(); updateFrameMaskFromProperty(); m_frameWindow->onDevicePixelRatioChanged(); } void DPlatformWindowHelper::onScreenChanged(QScreen *screen) { QScreen *old_screen = m_nativeWindow->window()->screen(); if (old_screen != screen) { m_nativeWindow->window()->setScreen(screen); } onDevicePixelRatioChanged(); } void DPlatformWindowHelper::updateClipPathFromProperty() { const QVariant &v = m_nativeWindow->window()->property(clipPath); QPainterPath path; path = qvariant_cast(v); if (!m_isUserSetClipPath && path.isEmpty()) return; m_isUserSetClipPath = !path.isEmpty(); if (m_isUserSetClipPath) setClipPath(path); else updateClipPathByWindowRadius(m_nativeWindow->window()->size()); } void DPlatformWindowHelper::updateFrameMaskFromProperty() { const QVariant &v = m_nativeWindow->window()->property(frameMask); if (!v.isValid()) { return; } QRegion region = qvariant_cast(v); m_frameWindow->setMask(region * m_nativeWindow->window()->devicePixelRatio()); m_isUserSetFrameMask = !region.isEmpty(); m_frameWindow->m_enableAutoFrameMask = !m_isUserSetFrameMask; } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformwindowhelper.h000066400000000000000000000125641476226662200231350ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DPLATFORMWINDOWHELPER_H #define DPLATFORMWINDOWHELPER_H #include #ifdef Q_OS_LINUX #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #include #endif #define private public #include "qxcbwindow.h" #include "qxcbclipboard.h" typedef QXcbWindow QNativeWindow; #undef private #elif defined(Q_OS_WIN) #include "qwindowswindow.h" typedef QWindowsWindow QNativeWindow; #endif #include "global.h" #include "utility.h" DPP_BEGIN_NAMESPACE class DFrameWindow; class DPlatformWindowHelper : public QObject { Q_OBJECT public: explicit DPlatformWindowHelper(QNativeWindow *window); ~DPlatformWindowHelper(); QNativeWindow *window() const { return static_cast(reinterpret_cast(const_cast(this)));} DPlatformWindowHelper *me() const; void setGeometry(const QRect &rect); QRect geometry() const; QRect normalGeometry() const; QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) void setWindowState(Qt::WindowState state); #else void setWindowState(Qt::WindowStates state); #endif WId winId() const; void setParent(const QPlatformWindow *window); void setWindowTitle(const QString &title); void setWindowFilePath(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); bool isExposed() const; // bool isActive() const; #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) bool isEmbedded() const; #else bool isEmbedded(const QPlatformWindow *parentWindow = 0) const; #endif void propagateSizeHints(); void setOpacity(qreal level); void requestActivateWindow(); bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); bool setWindowModified(bool modified); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) bool startSystemResize(const QPoint &pos, Qt::Corner corner); #else bool startSystemResize(Qt::Edges edges); #endif void setFrameStrutEventsEnabled(bool enabled); bool frameStrutEventsEnabled() const; void setAlertState(bool enabled); bool isAlertState() const; static bool windowRedirectContent(QWindow *window); private: bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; void setNativeWindowGeometry(const QRect &rect, bool onlyResize = false); void updateClipPathByWindowRadius(const QSize &windowSize); void setClipPath(const QPainterPath &path); void setWindowValidGeometry(const QRect &geometry, bool force = false); bool updateWindowBlurAreasForWM(); void updateSizeHints(); void updateContentPathForFrameWindow(); void updateContentWindowGeometry(); #ifdef Q_OS_LINUX void updateWindowNormalHints(); #endif void updateWindowShape(); int getWindowRadius() const; int getShadowRadius() const; int getBorderWidth() const; QColor getBorderColor() const; // update properties Q_SLOT void updateClipPathFromProperty(); Q_SLOT void updateFrameMaskFromProperty(); Q_SLOT void updateWindowRadiusFromProperty(); Q_SLOT void updateBorderWidthFromProperty(); Q_SLOT void updateBorderColorFromProperty(); Q_SLOT void updateShadowRadiusFromProperty(); Q_SLOT void updateShadowOffsetFromProperty(); Q_SLOT void updateShadowColorFromProperty(); Q_SLOT void updateEnableSystemResizeFromProperty(); Q_SLOT void updateEnableSystemMoveFromProperty(); Q_SLOT void updateEnableBlurWindowFromProperty(); Q_SLOT void updateWindowBlurAreasFromProperty(); Q_SLOT void updateWindowBlurPathsFromProperty(); Q_SLOT void updateAutoInputMaskByClipPathFromProperty(); static void setWindowProperty(QWindow *window, const char *name, const QVariant &value); void onFrameWindowContentMarginsHintChanged(const QMargins &old_margins); void onWMHasCompositeChanged(); void onDevicePixelRatioChanged(); void onScreenChanged(QScreen *screen); static QHash mapped; QNativeWindow *m_nativeWindow; DFrameWindow *m_frameWindow; QRect m_windowValidGeometry; // properties bool m_isUserSetClipPath = false; QPainterPath m_clipPath; bool m_isUserSetFrameMask = false; int m_windowRadius = 4; bool m_isUserSetWindowRadius = false; int m_borderWidth = 1; bool m_isUserSetBorderWidth = false; QColor m_borderColor = QColor(0, 0, 0, 255 * 0.15); int m_shadowRadius = 60; QPoint m_shadowOffset = QPoint(0, 16); QColor m_shadowColor = QColor(0, 0, 0, 255 * 0.6); bool m_enableSystemResize = true; bool m_enableSystemMove = true; bool m_enableBlurWindow = false; bool m_autoInputMaskByClipPath = true; bool m_enableShadow = true; QVector m_blurAreaList; QList m_blurPathList; #ifdef Q_OS_LINUX uint32_t damage_id = 0; #endif friend class DPlatformBackingStoreHelper; friend class DPlatformOpenGLContextHelper; friend class DPlatformIntegration; friend class DPlatformNativeInterfaceHook; friend class XcbNativeEventFilter; friend class WindowEventHook; friend QWindow *topvelWindow(QWindow *); }; DPP_END_NAMESPACE #endif // DPLATFORMWINDOWHELPER_H qt5platform-plugins-5.7.12/xcb/dplatformwindowhook.cpp000066400000000000000000000203361476226662200231450ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dplatformwindowhook.h" #include "vtablehook.h" #include "global.h" #include "utility.h" #include #ifdef Q_OS_LINUX #include "dxcbwmsupport.h" #include #include #endif #define HOOK_VFPTR(Fun) VtableHook::overrideVfptrFun(window, &QPlatformWindow::Fun, this, &DPlatformWindowHook::Fun) #define CALL this->window()->QNativeWindow DPP_BEGIN_NAMESPACE PUBLIC_CLASS(QNativeWindow, DPlatformWindowHook); QHash DPlatformWindowHook::mapped; DPlatformWindowHook::DPlatformWindowHook(QNativeWindow *window) : QObject(window->window()) , nativeWindow(window) { mapped[window] = this; HOOK_VFPTR(setGeometry); HOOK_VFPTR(geometry); HOOK_VFPTR(frameMargins); // HOOK_VFPTR(setParent); // HOOK_VFPTR(setWindowTitle); // HOOK_VFPTR(setWindowIcon); HOOK_VFPTR(mapToGlobal); HOOK_VFPTR(mapFromGlobal); HOOK_VFPTR(setMask); #ifdef Q_OS_LINUX HOOK_VFPTR(setWindowState); HOOK_VFPTR(setVisible); #endif HOOK_VFPTR(propagateSizeHints); HOOK_VFPTR(requestActivateWindow); } DPlatformWindowHook::~DPlatformWindowHook() { mapped.remove(nativeWindow); VtableHook::clearGhostVtable(static_cast(nativeWindow)); } DPlatformWindowHook *DPlatformWindowHook::me() const { return getHookByWindow(window()); } void DPlatformWindowHook::setGeometry(const QRect &rect) { const QMargins &margins = me()->windowMargins; emit me()->windowGeometryAboutChanged(rect); CALL::setGeometry(rect + margins); } QRect DPlatformWindowHook::geometry() const { const QMargins &margins = me()->windowMargins; // qDebug() << __FUNCTION__ << CALL::geometry() << CALL::window()->isVisible(); return CALL::geometry() - margins; } QMargins DPlatformWindowHook::frameMargins() const { return QMargins(); } void DPlatformWindowHook::setParent(const QPlatformWindow *window) { CALL::setParent(window); } void DPlatformWindowHook::setWindowTitle(const QString &title) { return CALL::setWindowTitle(title); } void DPlatformWindowHook::setWindowIcon(const QIcon &icon) { return CALL::setWindowIcon(icon); } QPoint DPlatformWindowHook::mapToGlobal(const QPoint &pos) const { DPlatformWindowHook *me = DPlatformWindowHook::me(); return CALL::mapToGlobal(pos + QPoint(me->windowMargins.left(), me->windowMargins.top())); } QPoint DPlatformWindowHook::mapFromGlobal(const QPoint &pos) const { DPlatformWindowHook *me = DPlatformWindowHook::me(); return CALL::mapFromGlobal(pos - QPoint(me->windowMargins.left(), me->windowMargins.top())); } void DPlatformWindowHook::setMask(const QRegion ®ion) { QRegion tmp_region; const QMargins &margins = me()->windowMargins; QRect window_rect = CALL::geometry() - margins; window_rect.moveTopLeft(QPoint(margins.left(), margins.top())); for (const QRect &rect : region.rects()) { tmp_region += rect.translated(window_rect.topLeft()).intersected(window_rect) + margins; } QPainterPath path; path.addRegion(region); CALL::window()->setProperty(clipPath, QVariant::fromValue(path)); // CALL::setMask(tmp_region); Utility::setShapeRectangles(CALL::winId(), tmp_region); } #ifdef Q_OS_LINUX void DPlatformWindowHook::setWindowState(Qt::WindowState state) { DQNativeWindow *window = static_cast(this->window()); if (window->m_windowState == state) return; if (state == Qt::WindowMinimized && (window->m_windowState == Qt::WindowMaximized || window->m_windowState == Qt::WindowFullScreen)) { window->changeNetWmState(true, Utility::internAtom("_NET_WM_STATE_HIDDEN")); XIconifyWindow(QX11Info::display(), window->m_window, QX11Info::appScreen()); window->connection()->sync(); window->m_windowState = state; } else { CALL::setWindowState(state); } } void DPlatformWindowHook::setVisible(bool visible) { if (!visible) { return CALL::setVisible(visible); } // reupdate _MOTIF_WM_HINTS DQNativeWindow *window = static_cast(this->window()); Utility::QtMotifWmHints mwmhints = Utility::getMotifWmHints(window->m_window); if (window->window()->modality() != Qt::NonModal) { switch (window->window()->modality()) { case Qt::WindowModal: mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_PRIMARY_APPLICATION_MODAL; break; case Qt::ApplicationModal: default: mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_FULL_APPLICATION_MODAL; break; } mwmhints.flags |= DXcbWMSupport::MWM_HINTS_INPUT_MODE; } else { mwmhints.input_mode = DXcbWMSupport::MWM_INPUT_MODELESS; mwmhints.flags &= ~DXcbWMSupport::MWM_HINTS_INPUT_MODE; } if (window->windowMinimumSize() == window->windowMaximumSize()) { // fixed size, remove the resize handle (since mwm/dtwm // isn't smart enough to do it itself) mwmhints.flags |= DXcbWMSupport::MWM_HINTS_FUNCTIONS; mwmhints.functions &= ~DXcbWMSupport::MWM_FUNC_RESIZE; if (mwmhints.decorations == DXcbWMSupport::MWM_DECOR_ALL) { mwmhints.flags |= DXcbWMSupport::MWM_HINTS_DECORATIONS; mwmhints.decorations = (DXcbWMSupport::MWM_DECOR_BORDER | DXcbWMSupport::MWM_DECOR_TITLE | DXcbWMSupport::MWM_DECOR_MENU); } else { mwmhints.decorations &= ~DXcbWMSupport::MWM_DECOR_RESIZEH; } } if (window->window()->flags() & Qt::WindowMinimizeButtonHint) { mwmhints.functions |= DXcbWMSupport::MWM_FUNC_MINIMIZE; } if (window->window()->flags() & Qt::WindowMaximizeButtonHint) { mwmhints.functions |= DXcbWMSupport::MWM_FUNC_MAXIMIZE; } if (window->window()->flags() & Qt::WindowCloseButtonHint) mwmhints.functions |= DXcbWMSupport::MWM_FUNC_CLOSE; CALL::setVisible(visible); // Fix the window can't show minimized if window is fixed size Utility::setMotifWmHints(window->m_window, mwmhints); } void DPlatformWindowHook::requestActivateWindow() { if (!window()->isExposed() && !DXcbWMSupport::instance()->hasComposite() && window()->window()->windowState() == Qt::WindowMinimized) { Q_XCB_CALL(xcb_map_window(window()->xcb_connection(), window()->winId())); } CALL::requestActivateWindow(); } #endif void DPlatformWindowHook::propagateSizeHints() { QWindow *win = window()->window(); QWindowPrivate *winp = qt_window_private(win); win->setProperty(userWindowMinimumSize, winp->minimumSize); win->setProperty(userWindowMaximumSize, winp->maximumSize); const QMargins &windowMargins = me()->windowMargins; const QSize &marginSize = QSize(windowMargins.left() + windowMargins.right(), windowMargins.top() + windowMargins.bottom()); winp->minimumSize += marginSize / win->screen()->devicePixelRatio(); winp->maximumSize += marginSize / win->screen()->devicePixelRatio(); winp->maximumSize.setWidth(qMin(QWINDOWSIZE_MAX, winp->maximumSize.width())); winp->maximumSize.setHeight(qMin(QWINDOWSIZE_MAX, winp->maximumSize.height())); CALL::propagateSizeHints(); // qDebug() << winp->minimumSize << winp->maximumSize << marginSize; } DPlatformWindowHook *DPlatformWindowHook::getHookByWindow(const QPlatformWindow *window) { return mapped.value(window); } void DPlatformWindowHook::setWindowMargins(const QMargins &margins, bool propagateSizeHints) { windowMargins = margins; if (!propagateSizeHints) { return; } QWindow *win = nativeWindow->window(); QWindowPrivate *winp = qt_window_private(win); const QSize &user_max_size = win->property(userWindowMaximumSize).toSize(); const QSize &user_min_size = win->property(userWindowMinimumSize).toSize(); if (user_max_size.isValid()) { winp->maximumSize = user_max_size; } if (user_min_size.isValid()) { winp->minimumSize = user_min_size; } static_cast(nativeWindow)->propagateSizeHints(); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dplatformwindowhook.h000066400000000000000000000036231476226662200226120ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef TESTWINDOW_H #define TESTWINDOW_H #include #ifdef Q_OS_LINUX #define private public #include "qxcbwindow.h" #include "qxcbclipboard.h" typedef QXcbWindow QNativeWindow; #undef private #elif defined(Q_OS_WIN) #include "qwindowswindow.h" typedef QWindowsWindow QNativeWindow; #endif #include "global.h" DPP_BEGIN_NAMESPACE class DPlatformWindowHook : public QObject { Q_OBJECT public: DPlatformWindowHook(QNativeWindow *window); ~DPlatformWindowHook(); QNativeWindow *window() const { return static_cast(reinterpret_cast(const_cast(this)));} DPlatformWindowHook *me() const; void setGeometry(const QRect &rect); QRect geometry() const; QMargins frameMargins() const; void setParent(const QPlatformWindow *window); void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setMask(const QRegion ®ion); #ifdef Q_OS_LINUX void setWindowState(Qt::WindowState state); void setVisible(bool visible); void requestActivateWindow(); #endif // bool startSystemResize(const QPoint &pos, Qt::Corner corner); void propagateSizeHints(); static DPlatformWindowHook *getHookByWindow(const QPlatformWindow *window); signals: void windowGeometryAboutChanged(const QRect &rect); private: void setWindowMargins(const QMargins &margins, bool propagateSizeHints = false); QMargins windowMargins; static QHash mapped; QNativeWindow *nativeWindow; friend class DPlatformBackingStore; }; DPP_END_NAMESPACE Q_DECLARE_METATYPE(QPainterPath) #endif // TESTWINDOW_H qt5platform-plugins-5.7.12/xcb/dpp.json000066400000000000000000000000431476226662200200070ustar00rootroot00000000000000{ "Keys" : [ "xcb", "dxcb" ] } qt5platform-plugins-5.7.12/xcb/dwmsupport.h000066400000000000000000000005551476226662200207360ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DWMSUPPORT_H #define DWMSUPPORT_H #include #include "global.h" DPP_USE_NAMESPACE #ifdef Q_OS_LINUX #include "dxcbwmsupport.h" typedef DXcbWMSupport DWMSupport; #elif defined(Q_OS_WIN) #endif #endif // DWMSUPPORT_H qt5platform-plugins-5.7.12/xcb/dxcbwmsupport.cpp000066400000000000000000000444561476226662200217760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dxcbwmsupport.h" #include "dplatformintegration.h" #include "utility.h" #include "dframewindow.h" #include "qxcbconnection.h" #define private public #include "qxcbscreen.h" #undef private #include "qxcbwindow.h" #include "3rdparty/clientwin.h" DPP_BEGIN_NAMESPACE class _DXcbWMSupport : public DXcbWMSupport {}; Q_GLOBAL_STATIC(_DXcbWMSupport, globalXWMS) DXcbWMSupport::DXcbWMSupport() { updateWMName(false); connect(this, &DXcbWMSupport::windowMotifWMHintsChanged, this, [this] (quint32 winId) { for (const DFrameWindow *frame : DFrameWindow::frameWindowList) { if (frame->m_contentWindow && frame->m_contentWindow->handle() && static_cast(frame->m_contentWindow->handle())->QXcbWindow::winId() == winId) { if (frame->handle()) emit windowMotifWMHintsChanged(frame->handle()->winId()); break; } } }); } void DXcbWMSupport::updateWMName(bool emitSignal) { _net_wm_deepin_blur_region_rounded_atom = Utility::internAtom(QT_STRINGIFY(_NET_WM_DEEPIN_BLUR_REGION_ROUNDED), false); _net_wm_deepin_blur_region_mask = Utility::internAtom(QT_STRINGIFY(_NET_WM_DEEPIN_BLUR_REGION_MASK), false); _kde_net_wm_blur_rehind_region_atom = Utility::internAtom(QT_STRINGIFY(_KDE_NET_WM_BLUR_BEHIND_REGION), false); _deepin_wallpaper = Utility::internAtom(QT_STRINGIFY(_DEEPIN_WALLPAPER), false); _deepin_wallpaper_shared_key = Utility::internAtom(QT_STRINGIFY(_DEEPIN_WALLPAPER_SHARED_MEMORY), false); _deepin_no_titlebar = Utility::internAtom(QT_STRINGIFY(_DEEPIN_NO_TITLEBAR), false); _deepin_scissor_window = Utility::internAtom(QT_STRINGIFY(_DEEPIN_SCISSOR_WINDOW), false); m_wmName.clear(); xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root(); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection, xcb_get_property_unchecked(xcb_connection, false, root, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_SUPPORTING_WM_CHECK)), XCB_ATOM_WINDOW, 0, 1024), NULL); if (reply && reply->format == 32 && reply->type == XCB_ATOM_WINDOW) { xcb_window_t windowManager = *((xcb_window_t *)xcb_get_property_value(reply)); if (windowManager != XCB_WINDOW_NONE) { xcb_get_property_reply_t *windowManagerReply = xcb_get_property_reply(xcb_connection, xcb_get_property_unchecked(xcb_connection, false, windowManager, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_NAME)), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(UTF8_STRING)), 0, 1024), NULL); if (windowManagerReply && windowManagerReply->format == 8 && windowManagerReply->type == DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(UTF8_STRING))) { m_wmName = QString::fromUtf8((const char *)xcb_get_property_value(windowManagerReply), xcb_get_property_value_length(windowManagerReply)); } free(windowManagerReply); } } free(reply); m_isDeepinWM = (m_wmName == QStringLiteral("Mutter(DeepinGala)")); m_isKwin = !m_isDeepinWM && (m_wmName == QStringLiteral("KWin")); updateHasComposite(); updateNetWMAtoms(); updateRootWindowProperties(); if (emitSignal) emit windowManagerChanged(); } void DXcbWMSupport::updateNetWMAtoms() { net_wm_atoms.clear(); xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root(); int offset = 0; int remaining = 0; xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); do { xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection, false, root, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_SUPPORTED)), XCB_ATOM_ATOM, offset, 1024); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection, cookie, NULL); if (!reply) break; remaining = 0; if (reply->type == XCB_ATOM_ATOM && reply->format == 32) { int len = xcb_get_property_value_length(reply)/sizeof(xcb_atom_t); xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply); int s = net_wm_atoms.size(); net_wm_atoms.resize(s + len); memcpy(net_wm_atoms.data() + s, atoms, len*sizeof(xcb_atom_t)); remaining = reply->bytes_after; offset += len; } free(reply); } while (remaining > 0); updateHasBlurWindow(); updateHasNoTitlebar(); updateHasScissorWindow(); updateWallpaperEffect(); } void DXcbWMSupport::updateRootWindowProperties() { root_window_properties.clear(); xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root(); xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_list_properties_cookie_t cookie = xcb_list_properties(xcb_connection, root); xcb_list_properties_reply_t *reply = xcb_list_properties_reply(xcb_connection, cookie, NULL); if (!reply) return; int len = xcb_list_properties_atoms_length(reply); xcb_atom_t *atoms = (xcb_atom_t *)xcb_list_properties_atoms(reply); root_window_properties.resize(len); memcpy(root_window_properties.data(), atoms, len * sizeof(xcb_atom_t)); free(reply); updateHasBlurWindow(); } void DXcbWMSupport::updateHasBlurWindow() { bool hasBlurWindow((m_isDeepinWM && isSupportedByWM(_net_wm_deepin_blur_region_rounded_atom)) || (m_isKwin && isContainsForRootWindow(_kde_net_wm_blur_rehind_region_atom))); // 当窗口visual不支持alpha通道时,也等价于不支持窗口背景模糊 hasBlurWindow = hasBlurWindow && getHasWindowAlpha(); if (m_hasBlurWindow == hasBlurWindow) return; m_hasBlurWindow = hasBlurWindow; emit hasBlurWindowChanged(hasBlurWindow); } void DXcbWMSupport::updateHasComposite() { bool hasComposite; xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); auto atom = Utility::internAtom("_NET_KDE_COMPOSITE_TOGGLING"); xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root(); //stage1: check if _NET_KDE_COMPOSITE_TOGGLING is supported xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection, xcb_get_property_unchecked(xcb_connection, false, root, atom, atom, 0, 1), NULL); if (reply && reply->type != XCB_NONE) { int value = 0; if (reply->type == atom && reply->format == 8) { value = *(int*)xcb_get_property_value(reply); } hasComposite = value == 1; free(reply); // 及时更新Qt中记录的值,KWin在关闭窗口合成的一段时间内(2S)并未释放相关的selection owner // 因此会导致Qt中的值在某个阶段与真实状态不匹配,用到QX11Info::isCompositingManagerRunning() // 的地方会出现问题,如drag窗口 DPlatformIntegration::xcbConnection()->primaryVirtualDesktop()->m_compositingActive = hasComposite; } else { //stage2: fallback to check selection owner xcb_get_selection_owner_cookie_t cookit = xcb_get_selection_owner(xcb_connection, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_CM_S0))); xcb_get_selection_owner_reply_t *reply = xcb_get_selection_owner_reply(xcb_connection, cookit, NULL); if (!reply) return; hasComposite = reply->owner != XCB_NONE; free(reply); } if (m_hasComposite == hasComposite) return; m_hasComposite = hasComposite; emit hasCompositeChanged(hasComposite); } void DXcbWMSupport::updateHasNoTitlebar() { bool hasNoTitlebar(net_wm_atoms.contains(_deepin_no_titlebar)); if (m_hasNoTitlebar == hasNoTitlebar) return; m_hasNoTitlebar = hasNoTitlebar; emit hasNoTitlebarChanged(m_hasNoTitlebar); } void DXcbWMSupport::updateHasScissorWindow() { bool hasScissorWindow(net_wm_atoms.contains(_deepin_scissor_window) && hasComposite()); if (m_hasScissorWindow == hasScissorWindow) return; m_hasScissorWindow = hasScissorWindow; emit hasScissorWindowChanged(m_hasScissorWindow); } void DXcbWMSupport::updateWallpaperEffect() { bool hasWallpaperEffect(net_wm_atoms.contains(_deepin_wallpaper)); if (m_hasWallpaperEffect == hasWallpaperEffect) return; m_hasWallpaperEffect = hasWallpaperEffect; emit hasWallpaperEffectChanged(hasWallpaperEffect); } qint8 DXcbWMSupport::getHasWindowAlpha() const { if (m_windowHasAlpha < 0) { // 测试窗口visual是否支持alpha通道 QWindow test_window; QSurfaceFormat sf = test_window.format(); sf.setDepthBufferSize(32); sf.setAlphaBufferSize(8); test_window.setFormat(sf); test_window.create(); // 当窗口位深不等于32时即认为它不支持alpha通道 const_cast(this)->m_windowHasAlpha = static_cast(test_window.handle())->depth() == 32; } return m_windowHasAlpha; } DXcbWMSupport *DXcbWMSupport::instance() { return globalXWMS; } bool DXcbWMSupport::connectWindowManagerChangedSignal(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::windowManagerChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::windowManagerChanged, object, slot); } bool DXcbWMSupport::connectHasBlurWindowChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::hasBlurWindowChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::hasBlurWindowChanged, object, slot); } bool DXcbWMSupport::connectHasCompositeChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::hasCompositeChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::hasCompositeChanged, object, slot); } bool DXcbWMSupport::connectHasNoTitlebarChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::hasNoTitlebarChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::hasNoTitlebarChanged, object, slot); } bool DXcbWMSupport::connectHasWallpaperEffectChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::hasWallpaperEffectChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::hasWallpaperEffectChanged, object, slot); } bool DXcbWMSupport::connectWindowListChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::windowListChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::windowListChanged, object, slot); } bool DXcbWMSupport::connectWindowMotifWMHintsChanged(QObject *object, std::function slot) { if (!object) return QObject::connect(globalXWMS, &DXcbWMSupport::windowMotifWMHintsChanged, slot); return QObject::connect(globalXWMS, &DXcbWMSupport::windowMotifWMHintsChanged, object, slot); } void DXcbWMSupport::setMWMFunctions(quint32 winId, quint32 func) { // FIXME(zccrs): The Openbox window manager does not support the Motif Hints if (instance()->windowManagerName() == "Openbox") return; Utility::QtMotifWmHints hints = Utility::getMotifWmHints(winId); hints.flags |= MWM_HINTS_FUNCTIONS; hints.functions = func; Utility::setMotifWmHints(winId, hints); } quint32 DXcbWMSupport::getMWMFunctions(quint32 winId) { Utility::QtMotifWmHints hints = Utility::getMotifWmHints(winId); if (hints.flags & MWM_HINTS_FUNCTIONS) return hints.functions; return MWM_FUNC_ALL; } quint32 DXcbWMSupport::getRealWinId(quint32 winId) { for (const DFrameWindow *frame : DFrameWindow::frameWindowList) { if (frame->handle() && frame->handle()->winId() == winId && frame->m_contentWindow && frame->m_contentWindow->handle()) { return static_cast(frame->m_contentWindow->handle())->QXcbWindow::winId(); } } return winId; } void DXcbWMSupport::setMWMDecorations(quint32 winId, quint32 decor) { winId = getRealWinId(winId); Utility::QtMotifWmHints hints = Utility::getMotifWmHints(winId); hints.flags |= MWM_HINTS_DECORATIONS; hints.decorations = decor; Utility::setMotifWmHints(winId, hints); } quint32 DXcbWMSupport::getMWMDecorations(quint32 winId) { winId = getRealWinId(winId); Utility::QtMotifWmHints hints = Utility::getMotifWmHints(winId); if (hints.flags & MWM_HINTS_DECORATIONS) return hints.decorations; return MWM_DECOR_ALL; } void DXcbWMSupport::popupSystemWindowMenu(quint32 winId) { Utility::showWindowSystemMenu(winId); } QString DXcbWMSupport::windowManagerName() const { return m_wmName; } QVector DXcbWMSupport::allWindow() const { QVector window_list_stacking; xcb_window_t root = DPlatformIntegration::xcbConnection()->primaryScreen()->root(); int offset = 0; int remaining = 0; xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); do { xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection, false, root, Utility::internAtom("_NET_CLIENT_LIST_STACKING"), XCB_ATOM_WINDOW, offset, 1024); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection, cookie, NULL); if (!reply) break; remaining = 0; if (reply->type == XCB_ATOM_WINDOW && reply->format == 32) { int len = xcb_get_property_value_length(reply)/sizeof(xcb_window_t); xcb_window_t *windows = (xcb_window_t *)xcb_get_property_value(reply); int s = window_list_stacking.size(); window_list_stacking.resize(s + len); memcpy(window_list_stacking.data() + s, windows, len*sizeof(xcb_window_t)); remaining = reply->bytes_after; offset += len; } free(reply); } while (remaining > 0); return window_list_stacking; } static QXcbScreen *screenFromPoint(const QPoint &p) { for (QXcbScreen *screen : DPlatformIntegration::xcbConnection()->screens()) { if (screen->geometry().contains(p)) { return screen; } } return DPlatformIntegration::xcbConnection()->primaryScreen(); } xcb_window_t DXcbWMSupport::windowFromPoint(const QPoint &p) const { xcb_window_t wid = XCB_NONE; xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); xcb_window_t root = screenFromPoint(p)->root(); xcb_window_t parent = root; xcb_window_t child = root; int16_t x = static_cast(p.x()); int16_t y = static_cast(p.y()); auto translate_reply = Q_XCB_REPLY_UNCHECKED(xcb_translate_coordinates, xcb_connection, parent, child, x, y); if (!translate_reply) { return wid; } child = translate_reply->child; if (!child || child == root) return wid; child = Find_Client(xcb_connection, root, child); wid = child; return wid; } bool DXcbWMSupport::isDeepinWM() const { return m_isDeepinWM; } bool DXcbWMSupport::isKwin() const { return m_isKwin; } bool DXcbWMSupport::isSupportedByWM(xcb_atom_t atom) const { return net_wm_atoms.contains(atom); } bool DXcbWMSupport::isContainsForRootWindow(xcb_atom_t atom) const { return root_window_properties.contains(atom); } bool DXcbWMSupport::hasBlurWindow() const { return m_hasBlurWindow && getHasWindowAlpha(); } bool DXcbWMSupport::hasComposite() const { return m_hasComposite; } bool DXcbWMSupport::hasNoTitlebar() const { /* * NOTE(lxz): Some dtk windows may be started before the window manager, * and the rounded corners of the window cannot be set correctly, * and need to use environment variables to force the setting. */ if (qEnvironmentVariableIsSet("D_DXCB_FORCE_NO_TITLEBAR")) { return qEnvironmentVariableIntValue("D_DXCB_FORCE_NO_TITLEBAR") != 0; } static bool disable = qEnvironmentVariableIsSet("D_DXCB_DISABLE_NO_TITLEBAR"); return !disable && m_hasNoTitlebar; } bool DXcbWMSupport::hasScissorWindow() const { static bool disable = qEnvironmentVariableIsSet("D_DXCB_DISABLE_SCISSOR_WINDOW"); return !disable && m_hasScissorWindow; } bool DXcbWMSupport::hasWindowAlpha() const { // 窗管不支持混成时也等价于窗口visual不支持alpha通道 return m_hasComposite && getHasWindowAlpha(); } bool DXcbWMSupport::hasWallpaperEffect() const { return m_hasWallpaperEffect; } bool DXcbWMSupport::Global::hasBlurWindow() { return DXcbWMSupport::instance()->hasBlurWindow(); } bool DXcbWMSupport::Global::hasComposite() { // 为了兼容现有的dtk应用中的逻辑,此处默认认为窗管是否支持混成等价于窗口是否支持alpha通道 static bool composite_with_alpha = qgetenv("D_DXCB_COMPOSITE_WITH_WINDOW_ALPHA") != "0"; return composite_with_alpha ? hasWindowAlpha() : DXcbWMSupport::instance()->hasComposite(); } bool DXcbWMSupport::Global::hasNoTitlebar() { return DXcbWMSupport::instance()->hasNoTitlebar(); } bool DXcbWMSupport::Global::hasWindowAlpha() { return DXcbWMSupport::instance()->hasWindowAlpha(); } bool DXcbWMSupport::Global::hasWallpaperEffect() { return DXcbWMSupport::instance()->hasWallpaperEffect(); } QString DXcbWMSupport::Global::windowManagerName() { return DXcbWMSupport::instance()->windowManagerName(); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/dxcbwmsupport.h000066400000000000000000000123561476226662200214350ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef DXCBWMSUPPORT_H #define DXCBWMSUPPORT_H #include "global.h" #include #include #include #include QT_BEGIN_NAMESPACE class QWindow; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class DXcbWMSupport : public QObject { Q_OBJECT Q_PROPERTY(bool hasBlurWindow READ hasBlurWindow NOTIFY hasBlurWindowChanged) Q_PROPERTY(bool hasComposite READ hasComposite NOTIFY hasCompositeChanged) // 属性值只有可能在窗管是否支持混成时发生改变 Q_PROPERTY(bool hasWindowAlpha READ hasWindowAlpha FINAL) // 支持隐藏窗口标题栏 Q_PROPERTY(bool hasNoTitlebar READ hasNoTitlebar NOTIFY hasNoTitlebarChanged) // 支持窗口内容裁剪 Q_PROPERTY(bool hasScissorWindow READ hasScissorWindow NOTIFY hasScissorWindowChanged) // 支持窗口壁纸绘制 Q_PROPERTY(bool hasWallpaperEffect READ hasWallpaperEffect NOTIFY hasWallpaperEffectChanged) public: enum { MWM_HINTS_FUNCTIONS = (1L << 0), MWM_FUNC_ALL = (1L << 0), MWM_FUNC_RESIZE = (1L << 1), MWM_FUNC_MOVE = (1L << 2), MWM_FUNC_MINIMIZE = (1L << 3), MWM_FUNC_MAXIMIZE = (1L << 4), MWM_FUNC_CLOSE = (1L << 5), MWM_HINTS_DECORATIONS = (1L << 1), MWM_DECOR_ALL = (1L << 0), MWM_DECOR_BORDER = (1L << 1), MWM_DECOR_RESIZEH = (1L << 2), MWM_DECOR_TITLE = (1L << 3), MWM_DECOR_MENU = (1L << 4), MWM_DECOR_MINIMIZE = (1L << 5), MWM_DECOR_MAXIMIZE = (1L << 6), MWM_HINTS_INPUT_MODE = (1L << 2), MWM_INPUT_MODELESS = 0L, MWM_INPUT_PRIMARY_APPLICATION_MODAL = 1L, MWM_INPUT_FULL_APPLICATION_MODAL = 3L }; static DXcbWMSupport *instance(); struct Global { static bool hasBlurWindow(); static bool hasComposite(); static bool hasNoTitlebar(); static bool hasWindowAlpha(); static bool hasWallpaperEffect(); static QString windowManagerName(); }; static bool connectWindowManagerChangedSignal(QObject *object, std::function slot); static bool connectHasBlurWindowChanged(QObject *object, std::function slot); static bool connectHasCompositeChanged(QObject *object, std::function slot); static bool connectHasNoTitlebarChanged(QObject *object, std::function slot); static bool connectWindowListChanged(QObject *object, std::function slot); static bool connectHasWallpaperEffectChanged(QObject *object, std::function slot); static bool connectWindowMotifWMHintsChanged(QObject *object, std::function slot); static void setMWMFunctions(quint32 winId, quint32 func); static quint32 getMWMFunctions(quint32 winId); static void setMWMDecorations(quint32 windId, quint32 decor); static quint32 getMWMDecorations(quint32 winId); static void popupSystemWindowMenu(quint32 winId); bool isDeepinWM() const; bool isKwin() const; bool isSupportedByWM(xcb_atom_t atom) const; bool isContainsForRootWindow(xcb_atom_t atom) const; bool hasBlurWindow() const; bool hasComposite() const; bool hasNoTitlebar() const; bool hasScissorWindow() const; bool hasWindowAlpha() const; bool hasWallpaperEffect() const; QString windowManagerName() const; QVector allWindow() const; xcb_window_t windowFromPoint(const QPoint &p) const; signals: void windowManagerChanged(); void hasBlurWindowChanged(bool hasBlurWindow); void hasCompositeChanged(bool hasComposite); void hasNoTitlebarChanged(bool hasNoTitlebar); void hasScissorWindowChanged(bool hasScissorWindow); void hasWallpaperEffectChanged(bool hasWallpaperEffect); void windowListChanged(); void windowMotifWMHintsChanged(quint32 winId); void wallpaperSharedChanged(); protected: explicit DXcbWMSupport(); private: void updateWMName(bool emitSignal = true); void updateNetWMAtoms(); void updateRootWindowProperties(); void updateHasBlurWindow(); void updateHasComposite(); void updateHasNoTitlebar(); void updateHasScissorWindow(); void updateWallpaperEffect(); qint8 getHasWindowAlpha() const; static quint32 getRealWinId(quint32 winId); bool m_isDeepinWM = false; bool m_isKwin = false; bool m_hasBlurWindow = false; bool m_hasComposite = false; bool m_hasNoTitlebar = false; bool m_hasScissorWindow = false; bool m_hasWallpaperEffect = false; qint8 m_windowHasAlpha = -1; QString m_wmName; xcb_atom_t _net_wm_deepin_blur_region_rounded_atom = 0; xcb_atom_t _kde_net_wm_blur_rehind_region_atom = 0; xcb_atom_t _net_wm_deepin_blur_region_mask = 0; xcb_atom_t _deepin_wallpaper = 0; xcb_atom_t _deepin_wallpaper_shared_key = 0; xcb_atom_t _deepin_no_titlebar = 0; xcb_atom_t _deepin_scissor_window = 0; QVector net_wm_atoms; QVector root_window_properties; friend class XcbNativeEventFilter; friend class Utility; friend class DBackingStoreProxy; }; DPP_END_NAMESPACE #endif // DXCBWMSUPPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/000077500000000000000000000000001476226662200215075ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/000077500000000000000000000000001476226662200222305ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbbackingstore.h000066400000000000000000000024031476226662200257310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbclipboard.h000066400000000000000000000053271476226662200252250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbconnection.h000066400000000000000000000550511476226662200254240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender() const { return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down) { m_buttonState.setFlag(button, down); } Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; Qt::MouseButtons m_buttonState = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr), \ std::free \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr), \ std::free \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbcursor.h000066400000000000000000000044311476226662200245760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbdrag.h000066400000000000000000000076321476226662200242040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbexport.h000066400000000000000000000005771476226662200246110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbimage.h000066400000000000000000000016431476226662200243450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbintegration.h000066400000000000000000000065431476226662200256120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbkeyboard.h000066400000000000000000000061711476226662200250640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbmime.h000066400000000000000000000025611476226662200242120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbnativeinterface.h000066400000000000000000000122231476226662200264260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbobject.h000066400000000000000000000013051476226662200245240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbscreen.h000066400000000000000000000173031476226662200245420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbsessionmanager.h000066400000000000000000000026631476226662200263040ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263060ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260070ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbwindow.h000066400000000000000000000220541476226662200245710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.0/qxcbxsettings.h000066400000000000000000000020171476226662200253070ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/000077500000000000000000000000001476226662200222315ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbbackingstore.h000066400000000000000000000024031476226662200257320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbclipboard.h000066400000000000000000000053271476226662200252260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbconnection.h000066400000000000000000000550511476226662200254250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender() const { return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down) { m_buttonState.setFlag(button, down); } Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; Qt::MouseButtons m_buttonState = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr), \ std::free \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr), \ std::free \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbcursor.h000066400000000000000000000044311476226662200245770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbdrag.h000066400000000000000000000100041476226662200241700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbexport.h000066400000000000000000000005771476226662200246120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbimage.h000066400000000000000000000016431476226662200243460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbintegration.h000066400000000000000000000065431476226662200256130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbkeyboard.h000066400000000000000000000061711476226662200250650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbmime.h000066400000000000000000000025611476226662200242130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbnativeinterface.h000066400000000000000000000122231476226662200264270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbobject.h000066400000000000000000000013051476226662200245250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbscreen.h000066400000000000000000000173031476226662200245430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbsessionmanager.h000066400000000000000000000026631476226662200263050ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263070ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260100ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbwindow.h000066400000000000000000000220541476226662200245720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbwmsupport.h000066400000000000000000000012761476226662200253460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.10.1/qxcbxsettings.h000066400000000000000000000020171476226662200253100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/000077500000000000000000000000001476226662200222315ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbbackingstore.h000066400000000000000000000024371476226662200257410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbclipboard.h000066400000000000000000000053271476226662200252260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbconnection.h000066400000000000000000000566431476226662200254350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { #if Q_BYTE_ORDER == Q_BIG_ENDIAN return m_setup->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return m_setup->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender(int major = -1, int minor = -1) const { if (has_render_extension && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return has_shm; } bool hasShmFd() const { return has_shm_fd; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; bool has_shm = false; bool has_shm_fd = false; QPair m_xrenderVersion; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbcursor.h000066400000000000000000000052761476226662200246070ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbdrag.h000066400000000000000000000100041476226662200241700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbexport.h000066400000000000000000000005771476226662200246120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbimage.h000066400000000000000000000017121476226662200243430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbintegration.h000066400000000000000000000065431476226662200256130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbkeyboard.h000066400000000000000000000075041476226662200250660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbmime.h000066400000000000000000000025611476226662200242130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbnativeinterface.h000066400000000000000000000124711476226662200264340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbobject.h000066400000000000000000000013051476226662200245250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbscreen.h000066400000000000000000000173011476226662200245410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbsessionmanager.h000066400000000000000000000026631476226662200263050ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263070ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260100ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbwindow.h000066400000000000000000000226641476226662200246010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); bool doStartSystemMoveResize(const QPoint &globalPos, int corner); virtual void create(); virtual void destroy(); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbxkbcommon.h000066400000000000000000000245721476226662200252670ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.0/qxcbxsettings.h000066400000000000000000000020171476226662200253100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/000077500000000000000000000000001476226662200222325ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbbackingstore.h000066400000000000000000000026651476226662200257450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbclipboard.h000066400000000000000000000053271476226662200252270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbconnection.h000066400000000000000000000566451476226662200254400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { #if Q_BYTE_ORDER == Q_BIG_ENDIAN return m_setup->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return m_setup->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender(int major = -1, int minor = -1) const { if (has_render_extension && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return has_shm; } bool hasShmFd() const { return has_shm_fd; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; bool has_shm = false; bool has_shm_fd = false; QPair m_xrenderVersion; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbcursor.h000066400000000000000000000052761476226662200246100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbdrag.h000066400000000000000000000077551476226662200242140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbexport.h000066400000000000000000000005771476226662200246130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbimage.h000066400000000000000000000017121476226662200243440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbintegration.h000066400000000000000000000065441476226662200256150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbkeyboard.h000066400000000000000000000075041476226662200250670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbmime.h000066400000000000000000000023771476226662200242210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbnativeinterface.h000066400000000000000000000124711476226662200264350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbobject.h000066400000000000000000000013051476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbscreen.h000066400000000000000000000173011476226662200245420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbsessionmanager.h000066400000000000000000000026631476226662200263060ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263100ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260110ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbwindow.h000066400000000000000000000226641476226662200246020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); bool doStartSystemMoveResize(const QPoint &globalPos, int corner); virtual void create(); virtual void destroy(); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbwmsupport.h000066400000000000000000000012761476226662200253470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbxkbcommon.h000066400000000000000000000245721476226662200252700ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.1/qxcbxsettings.h000066400000000000000000000020171476226662200253110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/000077500000000000000000000000001476226662200222335ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbbackingstore.h000066400000000000000000000026651476226662200257460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbclipboard.h000066400000000000000000000053271476226662200252300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbconnection.h000066400000000000000000000571751476226662200254400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { #if Q_BYTE_ORDER == Q_BIG_ENDIAN return m_setup->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return m_setup->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender(int major = -1, int minor = -1) const { if (has_render_extension && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return has_shm; } bool hasShmFd() const { return has_shm_fd; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; bool has_shm = false; bool has_shm_fd = false; QPair m_xrenderVersion; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbcursor.h000066400000000000000000000052761476226662200246110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbdrag.h000066400000000000000000000077551476226662200242150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbexport.h000066400000000000000000000005771476226662200246140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbimage.h000066400000000000000000000017121476226662200243450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbintegration.h000066400000000000000000000065441476226662200256160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbkeyboard.h000066400000000000000000000075041476226662200250700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbmime.h000066400000000000000000000023771476226662200242220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbnativeinterface.h000066400000000000000000000124711476226662200264360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbobject.h000066400000000000000000000013051476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbscreen.h000066400000000000000000000170601476226662200245450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbsessionmanager.h000066400000000000000000000026631476226662200263070ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263110ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbwindow.h000066400000000000000000000226641476226662200246030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); virtual void create(); virtual void destroy(); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbwmsupport.h000066400000000000000000000012761476226662200253500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbxkbcommon.h000066400000000000000000000245721476226662200252710ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.2/qxcbxsettings.h000066400000000000000000000020171476226662200253120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/000077500000000000000000000000001476226662200222345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbbackingstore.h000066400000000000000000000026651476226662200257470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(QXcbConnection *c, size_t segmentSize = 1, void *shmInfo = nullptr); private: QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbclipboard.h000066400000000000000000000053271476226662200252310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbconnection.h000066400000000000000000000573301476226662200254320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xinput2) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return m_setup->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return m_setup->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); // Peek at all queued events qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); enum PeekOption { PeekDefault = 0, PeekFromCachedIndex = 1 }; // see qx11info_x11.h Q_DECLARE_FLAGS(PeekOptions, PeekOption) typedef bool (*PeekerCallback)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return has_xfixes; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool hasXRender(int major = -1, int minor = -1) const { if (has_render_extension && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return has_render_extension; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return has_shm; } bool hasShmFd() const { return has_shm_fd; } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #if QT_CONFIG(xinput2) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } Qt::MouseButton xiToQtMouseButton(uint32_t b); #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled = false; #if QT_CONFIG(xinput2) int m_xi2Minor = -1; void initializeXInput2(); void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; #ifdef XCB_USE_XINPUT21 void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); #endif static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xfixes = false; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; bool has_render_extension = false; bool has_shm = false; bool has_shm_fd = false; QPair m_xrenderVersion; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; bool m_mainEventLoopFlushedQueue = false; qint32 m_peekerIdSource = 0; bool m_peekerIndexCacheDirty = false; QHash m_peekerToCachedIndex; friend class QXcbEventReader; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbcursor.h000066400000000000000000000052761476226662200246120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbdrag.h000066400000000000000000000077551476226662200242160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbexport.h000066400000000000000000000005771476226662200246150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbimage.h000066400000000000000000000017121476226662200243460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbintegration.h000066400000000000000000000065441476226662200256170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbkeyboard.h000066400000000000000000000075041476226662200250710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xinput2) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbmime.h000066400000000000000000000023771476226662200242230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbnativeinterface.h000066400000000000000000000124711476226662200264370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData = nullptr, QXcbConnection::PeekOptions option = QXcbConnection::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbobject.h000066400000000000000000000013051476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbscreen.h000066400000000000000000000170261476226662200245500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } bool syncRequestSupported() const { return m_virtualDesktop->syncRequestSupported(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = 0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbsessionmanager.h000066400000000000000000000026631476226662200263100ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbvulkaninstance.h000066400000000000000000000022531476226662200263120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); void destroySurface(VkSurfaceKHR surface); private: QVulkanInstance *m_instance; QLibrary m_lib; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; PFN_vkDestroySurfaceKHR m_destroySurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260130ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbwindow.h000066400000000000000000000226641476226662200246040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xinput2) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); virtual void create(); virtual void destroy(); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbwmsupport.h000066400000000000000000000012761476226662200253510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbxkbcommon.h000066400000000000000000000245721476226662200252720ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.11.3/qxcbxsettings.h000066400000000000000000000020171476226662200253130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/000077500000000000000000000000001476226662200222325ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbatom.h000066400000000000000000000112361476226662200242240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbbackingstore.h000066400000000000000000000045361476226662200257440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: #if QT_CONFIG(xcb_render) void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; #endif bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbclipboard.h000066400000000000000000000053151476226662200252240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbconnection.h000066400000000000000000000331101476226662200254160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbconnection_basic.h000066400000000000000000000104161476226662200265630ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbcursor.h000066400000000000000000000052761476226662200246100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbdrag.h000066400000000000000000000107011476226662200241750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbeventdispatcher.h000066400000000000000000000041251476226662200264530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbeventqueue.h000066400000000000000000000067131476226662200254560ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbexport.h000066400000000000000000000005771476226662200246130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbimage.h000066400000000000000000000017121476226662200243440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbintegration.h000066400000000000000000000066351476226662200256160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbkeyboard.h000066400000000000000000000077471476226662200251000ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbmime.h000066400000000000000000000023771476226662200242210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbnativeinterface.h000066400000000000000000000116441476226662200264360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbobject.h000066400000000000000000000013051476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbscreen.h000066400000000000000000000164231476226662200245460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbsessionmanager.h000066400000000000000000000026631476226662200263060ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263070ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260110ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbwindow.h000066400000000000000000000223621476226662200245750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWmHints(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbxkbcommon.h000066400000000000000000000245721476226662200252700ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.0/qxcbxsettings.h000066400000000000000000000020171476226662200253110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/000077500000000000000000000000001476226662200222335ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbatom.h000066400000000000000000000112361476226662200242250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbbackingstore.h000066400000000000000000000044761476226662200257500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbclipboard.h000066400000000000000000000070221476226662200252220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbconnection.h000066400000000000000000000331631476226662200254270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbconnection_basic.h000066400000000000000000000104161476226662200265640ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbcursor.h000066400000000000000000000052761476226662200246110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbdrag.h000066400000000000000000000107011476226662200241760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbeventqueue.h000066400000000000000000000067131476226662200254570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbexport.h000066400000000000000000000005771476226662200246140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbimage.h000066400000000000000000000017121476226662200243450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbintegration.h000066400000000000000000000066351476226662200256170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbkeyboard.h000066400000000000000000000077471476226662200251010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbmime.h000066400000000000000000000023771476226662200242220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbnativeinterface.h000066400000000000000000000116441476226662200264370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbobject.h000066400000000000000000000013051476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbscreen.h000066400000000000000000000164401476226662200245460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbsessionmanager.h000066400000000000000000000026631476226662200263070ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263100ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbwindow.h000066400000000000000000000223041476226662200245720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbwmsupport.h000066400000000000000000000012761476226662200253500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbxkbcommon.h000066400000000000000000000245721476226662200252710ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.1/qxcbxsettings.h000066400000000000000000000020171476226662200253120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/000077500000000000000000000000001476226662200222345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbatom.h000066400000000000000000000112361476226662200242260ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbbackingstore.h000066400000000000000000000044761476226662200257510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbclipboard.h000066400000000000000000000070221476226662200252230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbconnection.h000066400000000000000000000331631476226662200254300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbconnection_basic.h000066400000000000000000000104161476226662200265650ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbcursor.h000066400000000000000000000052761476226662200246120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbdrag.h000066400000000000000000000107011476226662200241770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbeventqueue.h000066400000000000000000000072101476226662200254510ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbexport.h000066400000000000000000000005771476226662200246150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbimage.h000066400000000000000000000017121476226662200243460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbintegration.h000066400000000000000000000066351476226662200256200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbkeyboard.h000066400000000000000000000077471476226662200251020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbmime.h000066400000000000000000000023771476226662200242230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbnativeinterface.h000066400000000000000000000116441476226662200264400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbobject.h000066400000000000000000000013051476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbscreen.h000066400000000000000000000164401476226662200245470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbsessionmanager.h000066400000000000000000000026631476226662200263100ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263110ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260130ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbwindow.h000066400000000000000000000223041476226662200245730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbwmsupport.h000066400000000000000000000012761476226662200253510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbxkbcommon.h000066400000000000000000000245721476226662200252720ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.2/qxcbxsettings.h000066400000000000000000000020171476226662200253130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/000077500000000000000000000000001476226662200222355ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbatom.h000066400000000000000000000112361476226662200242270ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbbackingstore.h000066400000000000000000000044761476226662200257520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbclipboard.h000066400000000000000000000070221476226662200252240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbconnection.h000066400000000000000000000334501476226662200254300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbconnection_basic.h000066400000000000000000000104631476226662200265700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbcursor.h000066400000000000000000000052761476226662200246130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbdrag.h000066400000000000000000000107011476226662200242000ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbeventdispatcher.h000066400000000000000000000040501476226662200264530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbeventqueue.h000066400000000000000000000072101476226662200254520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbexport.h000066400000000000000000000005771476226662200246160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbimage.h000066400000000000000000000017121476226662200243470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbintegration.h000066400000000000000000000065151476226662200256160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbkeyboard.h000066400000000000000000000077471476226662200251030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbmime.h000066400000000000000000000023771476226662200242240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbnativeinterface.h000066400000000000000000000116441476226662200264410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbobject.h000066400000000000000000000013051476226662200245310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbscreen.h000066400000000000000000000164401476226662200245500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbsessionmanager.h000066400000000000000000000026631476226662200263110ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260140ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbwindow.h000066400000000000000000000223041476226662200245740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbwmsupport.h000066400000000000000000000012761476226662200253520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbxkbcommon.h000066400000000000000000000245721476226662200252730ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.3/qxcbxsettings.h000066400000000000000000000020171476226662200253140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/000077500000000000000000000000001476226662200222365ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbatom.h000066400000000000000000000112361476226662200242300ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbbackingstore.h000066400000000000000000000044761476226662200257530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbclipboard.h000066400000000000000000000070221476226662200252250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbconnection.h000066400000000000000000000334501476226662200254310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbconnection_basic.h000066400000000000000000000104631476226662200265710ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbcursor.h000066400000000000000000000052761476226662200246140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbdrag.h000066400000000000000000000107011476226662200242010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264550ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbeventqueue.h000066400000000000000000000072101476226662200254530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbexport.h000066400000000000000000000005771476226662200246170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbimage.h000066400000000000000000000017121476226662200243500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbintegration.h000066400000000000000000000065151476226662200256170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbkeyboard.h000066400000000000000000000077471476226662200251040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbmime.h000066400000000000000000000023771476226662200242250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbnativeinterface.h000066400000000000000000000116441476226662200264420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbobject.h000066400000000000000000000013051476226662200245320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbscreen.h000066400000000000000000000164401476226662200245510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbsessionmanager.h000066400000000000000000000026631476226662200263120ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263130ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260150ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbwindow.h000066400000000000000000000223041476226662200245750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbwmsupport.h000066400000000000000000000012761476226662200253530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbxkbcommon.h000066400000000000000000000245721476226662200252740ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.4/qxcbxsettings.h000066400000000000000000000020171476226662200253150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/000077500000000000000000000000001476226662200222375ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbatom.h000066400000000000000000000112361476226662200242310ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbbackingstore.h000066400000000000000000000044761476226662200257540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbclipboard.h000066400000000000000000000070221476226662200252260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbconnection.h000066400000000000000000000334501476226662200254320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbconnection_basic.h000066400000000000000000000104631476226662200265720ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbcursor.h000066400000000000000000000052761476226662200246150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbdrag.h000066400000000000000000000107011476226662200242020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264560ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbeventqueue.h000066400000000000000000000072101476226662200254540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbexport.h000066400000000000000000000005771476226662200246200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbimage.h000066400000000000000000000017121476226662200243510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbintegration.h000066400000000000000000000065151476226662200256200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbkeyboard.h000066400000000000000000000077471476226662200251050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbmime.h000066400000000000000000000023771476226662200242260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbnativeinterface.h000066400000000000000000000116441476226662200264430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbobject.h000066400000000000000000000013051476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbscreen.h000066400000000000000000000164731476226662200245600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbsessionmanager.h000066400000000000000000000026631476226662200263130ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263140ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260160ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbwindow.h000066400000000000000000000225501476226662200246010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbwmsupport.h000066400000000000000000000012761476226662200253540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbxkbcommon.h000066400000000000000000000245721476226662200252750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.5/qxcbxsettings.h000066400000000000000000000020171476226662200253160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/000077500000000000000000000000001476226662200222405ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbatom.h000066400000000000000000000112361476226662200242320ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbbackingstore.h000066400000000000000000000044761476226662200257550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbclipboard.h000066400000000000000000000070221476226662200252270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbconnection.h000066400000000000000000000334501476226662200254330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbconnection_basic.h000066400000000000000000000104631476226662200265730ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbcursor.h000066400000000000000000000052761476226662200246160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbdrag.h000066400000000000000000000107011476226662200242030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbeventqueue.h000066400000000000000000000072101476226662200254550ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbexport.h000066400000000000000000000005771476226662200246210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbimage.h000066400000000000000000000017121476226662200243520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbintegration.h000066400000000000000000000065151476226662200256210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbkeyboard.h000066400000000000000000000077471476226662200251060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbmime.h000066400000000000000000000023771476226662200242270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbnativeinterface.h000066400000000000000000000116441476226662200264440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbobject.h000066400000000000000000000013051476226662200245340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbscreen.h000066400000000000000000000164731476226662200245610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbsessionmanager.h000066400000000000000000000026631476226662200263140ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263150ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260170ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbwindow.h000066400000000000000000000225501476226662200246020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbwmsupport.h000066400000000000000000000012761476226662200253550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbxkbcommon.h000066400000000000000000000245721476226662200252760ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.6/qxcbxsettings.h000066400000000000000000000020171476226662200253170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/000077500000000000000000000000001476226662200222415ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbatom.h000066400000000000000000000112361476226662200242330ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbbackingstore.h000066400000000000000000000044761476226662200257560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbclipboard.h000066400000000000000000000070221476226662200252300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbconnection.h000066400000000000000000000334501476226662200254340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbconnection_basic.h000066400000000000000000000104631476226662200265740ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbcursor.h000066400000000000000000000052761476226662200246170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbdrag.h000066400000000000000000000107011476226662200242040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbeventqueue.h000066400000000000000000000072101476226662200254560ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbexport.h000066400000000000000000000005771476226662200246220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbimage.h000066400000000000000000000017121476226662200243530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbintegration.h000066400000000000000000000065151476226662200256220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbkeyboard.h000066400000000000000000000077471476226662200251070ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbmime.h000066400000000000000000000023771476226662200242300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbnativeinterface.h000066400000000000000000000116441476226662200264450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbobject.h000066400000000000000000000013051476226662200245350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbscreen.h000066400000000000000000000164731476226662200245620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbsessionmanager.h000066400000000000000000000026631476226662200263150ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263160ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260200ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbwindow.h000066400000000000000000000225501476226662200246030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbwmsupport.h000066400000000000000000000012761476226662200253560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbxkbcommon.h000066400000000000000000000245721476226662200252770ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.7/qxcbxsettings.h000066400000000000000000000020171476226662200253200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/000077500000000000000000000000001476226662200222425ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbatom.h000066400000000000000000000112741476226662200242360ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbbackingstore.h000066400000000000000000000044761476226662200257570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbclipboard.h000066400000000000000000000070221476226662200252310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbconnection.h000066400000000000000000000334501476226662200254350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbconnection_basic.h000066400000000000000000000104631476226662200265750ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbcursor.h000066400000000000000000000052761476226662200246200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbdrag.h000066400000000000000000000107011476226662200242050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264610ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbeventqueue.h000066400000000000000000000072101476226662200254570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbexport.h000066400000000000000000000005771476226662200246230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbimage.h000066400000000000000000000017121476226662200243540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbintegration.h000066400000000000000000000065151476226662200256230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbkeyboard.h000066400000000000000000000077471476226662200251100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbmime.h000066400000000000000000000023771476226662200242310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbnativeinterface.h000066400000000000000000000116441476226662200264460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbobject.h000066400000000000000000000013051476226662200245360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbscreen.h000066400000000000000000000164731476226662200245630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbsessionmanager.h000066400000000000000000000026631476226662200263160ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263170ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260210ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbwindow.h000066400000000000000000000226121476226662200246030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbwmsupport.h000066400000000000000000000012761476226662200253570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbxkbcommon.h000066400000000000000000000245721476226662200253000ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.8/qxcbxsettings.h000066400000000000000000000020171476226662200253210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/000077500000000000000000000000001476226662200222435ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbatom.h000066400000000000000000000113231476226662200242320ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbbackingstore.h000066400000000000000000000044761476226662200257600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbclipboard.h000066400000000000000000000070221476226662200252320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_increment; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_increment = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbconnection.h000066400000000000000000000334501476226662200254360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; QVector m_peekFuncs; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbconnection_basic.h000066400000000000000000000104631476226662200265760ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbcursor.h000066400000000000000000000052761476226662200246210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbdrag.h000066400000000000000000000120331476226662200242060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264620ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbeventqueue.h000066400000000000000000000072101476226662200254600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbexport.h000066400000000000000000000005771476226662200246240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbimage.h000066400000000000000000000017121476226662200243550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbintegration.h000066400000000000000000000065151476226662200256240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbkeyboard.h000066400000000000000000000077471476226662200251110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; QString lookupStringNoKeysymTransformations(xkb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers modifiers, struct xkb_state *state, xcb_keycode_t code) const; typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout() const; private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif struct XKBStateDeleter { void operator()(struct xkb_state *state) const { return xkb_state_unref(state); } }; struct XKBKeymapDeleter { void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); } }; struct XKBContextDeleter { void operator()(struct xkb_context *context) const { return xkb_context_unref(context); } }; using ScopedXKBState = std::unique_ptr; using ScopedXKBKeymap = std::unique_ptr; using ScopedXKBContext = std::unique_ptr; ScopedXKBState m_xkbState; ScopedXKBKeymap m_xkbKeymap; ScopedXKBContext m_xkbContext; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbmime.h000066400000000000000000000023771476226662200242320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbnativeinterface.h000066400000000000000000000116441476226662200264470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbobject.h000066400000000000000000000013051476226662200245370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbscreen.h000066400000000000000000000164731476226662200245640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbsessionmanager.h000066400000000000000000000026631476226662200263170ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263200ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260220ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbwindow.h000066400000000000000000000226121476226662200246040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbwmsupport.h000066400000000000000000000012761476226662200253600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbxkbcommon.h000066400000000000000000000245721476226662200253010ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* XConvertCase was copied from src/3rdparty/xkbcommon/src/keysym.c, which contains the following license information: Copyright 1985, 1987, 1990, 1998 The Open Group 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 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. Except as contained in this notice, the names of the authors or their institutions shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the authors. Copyright © 2009 Dan Nicholson 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 (including the next paragraph) 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. */ /* The following code modifications were applied: XConvertCase() was renamed to xkbcommon_XConvertCase(), to not confuse it with Xlib's XConvertCase(). UCSConvertCase() was renamed to qt_UCSConvertCase() and function's body was replaced to use Qt APIs for doing case conversion, which should give us better results instead of using the less complete version from keysym.c */ #include #include QT_BEGIN_NAMESPACE static void qt_UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper) { *lower = QChar::toLower(code); *upper = QChar::toUpper(code); } void xkbcommon_XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) { /* Latin 1 keysym */ if (sym < 0x100) { qt_UCSConvertCase(sym, lower, upper); return; } /* Unicode keysym */ if ((sym & 0xff000000) == 0x01000000) { qt_UCSConvertCase((sym & 0x00ffffff), lower, upper); *upper |= 0x01000000; *lower |= 0x01000000; return; } /* Legacy keysym */ *lower = sym; *upper = sym; switch (sym >> 8) { case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym == XKB_KEY_Aogonek) *lower = XKB_KEY_aogonek; else if (sym >= XKB_KEY_Lstroke && sym <= XKB_KEY_Sacute) *lower += (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_Scaron && sym <= XKB_KEY_Zacute) *lower += (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_Zcaron && sym <= XKB_KEY_Zabovedot) *lower += (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym == XKB_KEY_aogonek) *upper = XKB_KEY_Aogonek; else if (sym >= XKB_KEY_lstroke && sym <= XKB_KEY_sacute) *upper -= (XKB_KEY_lstroke - XKB_KEY_Lstroke); else if (sym >= XKB_KEY_scaron && sym <= XKB_KEY_zacute) *upper -= (XKB_KEY_scaron - XKB_KEY_Scaron); else if (sym >= XKB_KEY_zcaron && sym <= XKB_KEY_zabovedot) *upper -= (XKB_KEY_zcaron - XKB_KEY_Zcaron); else if (sym >= XKB_KEY_Racute && sym <= XKB_KEY_Tcedilla) *lower += (XKB_KEY_racute - XKB_KEY_Racute); else if (sym >= XKB_KEY_racute && sym <= XKB_KEY_tcedilla) *upper -= (XKB_KEY_racute - XKB_KEY_Racute); break; case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Hstroke && sym <= XKB_KEY_Hcircumflex) *lower += (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_Gbreve && sym <= XKB_KEY_Jcircumflex) *lower += (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_hstroke && sym <= XKB_KEY_hcircumflex) *upper -= (XKB_KEY_hstroke - XKB_KEY_Hstroke); else if (sym >= XKB_KEY_gbreve && sym <= XKB_KEY_jcircumflex) *upper -= (XKB_KEY_gbreve - XKB_KEY_Gbreve); else if (sym >= XKB_KEY_Cabovedot && sym <= XKB_KEY_Scircumflex) *lower += (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); else if (sym >= XKB_KEY_cabovedot && sym <= XKB_KEY_scircumflex) *upper -= (XKB_KEY_cabovedot - XKB_KEY_Cabovedot); break; case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Rcedilla && sym <= XKB_KEY_Tslash) *lower += (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym >= XKB_KEY_rcedilla && sym <= XKB_KEY_tslash) *upper -= (XKB_KEY_rcedilla - XKB_KEY_Rcedilla); else if (sym == XKB_KEY_ENG) *lower = XKB_KEY_eng; else if (sym == XKB_KEY_eng) *upper = XKB_KEY_ENG; else if (sym >= XKB_KEY_Amacron && sym <= XKB_KEY_Umacron) *lower += (XKB_KEY_amacron - XKB_KEY_Amacron); else if (sym >= XKB_KEY_amacron && sym <= XKB_KEY_umacron) *upper -= (XKB_KEY_amacron - XKB_KEY_Amacron); break; case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Serbian_DJE && sym <= XKB_KEY_Serbian_DZE) *lower -= (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Serbian_dje && sym <= XKB_KEY_Serbian_dze) *upper += (XKB_KEY_Serbian_DJE - XKB_KEY_Serbian_dje); else if (sym >= XKB_KEY_Cyrillic_YU && sym <= XKB_KEY_Cyrillic_HARDSIGN) *lower -= (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); else if (sym >= XKB_KEY_Cyrillic_yu && sym <= XKB_KEY_Cyrillic_hardsign) *upper += (XKB_KEY_Cyrillic_YU - XKB_KEY_Cyrillic_yu); break; case 7: /* Greek */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if (sym >= XKB_KEY_Greek_ALPHAaccent && sym <= XKB_KEY_Greek_OMEGAaccent) *lower += (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_alphaaccent && sym <= XKB_KEY_Greek_omegaaccent && sym != XKB_KEY_Greek_iotaaccentdieresis && sym != XKB_KEY_Greek_upsilonaccentdieresis) *upper -= (XKB_KEY_Greek_alphaaccent - XKB_KEY_Greek_ALPHAaccent); else if (sym >= XKB_KEY_Greek_ALPHA && sym <= XKB_KEY_Greek_OMEGA) *lower += (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); else if (sym >= XKB_KEY_Greek_alpha && sym <= XKB_KEY_Greek_omega && sym != XKB_KEY_Greek_finalsmallsigma) *upper -= (XKB_KEY_Greek_alpha - XKB_KEY_Greek_ALPHA); break; case 0x13: /* Latin 9 */ if (sym == XKB_KEY_OE) *lower = XKB_KEY_oe; else if (sym == XKB_KEY_oe) *upper = XKB_KEY_OE; else if (sym == XKB_KEY_Ydiaeresis) *lower = XKB_KEY_ydiaeresis; break; } } xkb_keysym_t xkbcommon_xkb_keysym_to_upper(xkb_keysym_t ks) { xkb_keysym_t lower, upper; xkbcommon_XConvertCase(ks, &lower, &upper); return upper; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.12.9/qxcbxsettings.h000066400000000000000000000020171476226662200253220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/000077500000000000000000000000001476226662200222335ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbatom.h000066400000000000000000000112361476226662200242250ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbbackingstore.h000066400000000000000000000044761476226662200257500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbclipboard.h000066400000000000000000000070661476226662200252320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbconnection.h000066400000000000000000000334061476226662200254270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState = 0; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbconnection_basic.h000066400000000000000000000106701476226662200265660ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbcursor.h000066400000000000000000000052761476226662200246110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbdrag.h000066400000000000000000000107011476226662200241760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbeventqueue.h000066400000000000000000000072101476226662200254500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbexport.h000066400000000000000000000005771476226662200246140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbimage.h000066400000000000000000000017121476226662200243450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbintegration.h000066400000000000000000000065151476226662200256140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbkeyboard.h000066400000000000000000000060661476226662200250720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbmime.h000066400000000000000000000023771476226662200242220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbnativeinterface.h000066400000000000000000000116441476226662200264370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbobject.h000066400000000000000000000013051476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbscreen.h000066400000000000000000000164401476226662200245460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_pixelDensity = 1; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbsessionmanager.h000066400000000000000000000026131476226662200263020ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263100ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbwindow.h000066400000000000000000000225501476226662200245750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.13.0/qxcbxsettings.h000066400000000000000000000020171476226662200253120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/000077500000000000000000000000001476226662200222345ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbatom.h000066400000000000000000000112361476226662200242260ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbbackingstore.h000066400000000000000000000044761476226662200257510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbclipboard.h000066400000000000000000000070661476226662200252330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbconnection.h000066400000000000000000000334221476226662200254260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState = nullptr; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbconnection_basic.h000066400000000000000000000106621476226662200265700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbcursor.h000066400000000000000000000052761476226662200246120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbdrag.h000066400000000000000000000107311476226662200242020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbeventqueue.h000066400000000000000000000072101476226662200254510ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbexport.h000066400000000000000000000005771476226662200246150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbimage.h000066400000000000000000000017121476226662200243460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbintegration.h000066400000000000000000000065151476226662200256150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbkeyboard.h000066400000000000000000000060661476226662200250730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbmime.h000066400000000000000000000023771476226662200242230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbnativeinterface.h000066400000000000000000000116441476226662200264400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbobject.h000066400000000000000000000013131476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbscreen.h000066400000000000000000000164751476226662200245570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbsessionmanager.h000066400000000000000000000026131476226662200263030ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263110ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260130ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbwindow.h000066400000000000000000000225561476226662200246040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.0/qxcbxsettings.h000066400000000000000000000020171476226662200253130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/000077500000000000000000000000001476226662200222355ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbatom.h000066400000000000000000000112361476226662200242270ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbbackingstore.h000066400000000000000000000044761476226662200257520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbclipboard.h000066400000000000000000000070661476226662200252340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbconnection.h000066400000000000000000000334221476226662200254270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; #if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); #endif bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } #if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; #endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState = nullptr; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbconnection_basic.h000066400000000000000000000106621476226662200265710ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; #if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; #endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); #if QT_CONFIG(xcb_xinput) void initializeXInput2(); #endif private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; #if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; #endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbcursor.h000066400000000000000000000052761476226662200246130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbdrag.h000066400000000000000000000107311476226662200242030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbeventqueue.h000066400000000000000000000072101476226662200254520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbexport.h000066400000000000000000000005771476226662200246160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbimage.h000066400000000000000000000017121476226662200243470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbintegration.h000066400000000000000000000065151476226662200256160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbkeyboard.h000066400000000000000000000060661476226662200250740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbmime.h000066400000000000000000000023771476226662200242240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbnativeinterface.h000066400000000000000000000116441476226662200264410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbobject.h000066400000000000000000000013131476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbscreen.h000066400000000000000000000164751476226662200245600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbsessionmanager.h000066400000000000000000000026131476226662200263040ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260140ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbwindow.h000066400000000000000000000226271476226662200246040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; bool startSystemMove(const QPoint &pos) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int corner); void doStartSystemMoveResize(const QPoint &globalPos, int corner); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbwmsupport.h000066400000000000000000000012761476226662200253520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.14.1/qxcbxsettings.h000066400000000000000000000020171476226662200253140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/000077500000000000000000000000001476226662200222355ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbatom.h000066400000000000000000000113231476226662200242240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbbackingstore.h000066400000000000000000000044761476226662200257520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbclipboard.h000066400000000000000000000070661476226662200252340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbconnection.h000066400000000000000000000331111476226662200254220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbconnection_basic.h000066400000000000000000000105171476226662200265700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbcursor.h000066400000000000000000000052761476226662200246130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbdrag.h000066400000000000000000000120431476226662200242010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbeventqueue.h000066400000000000000000000072101476226662200254520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbexport.h000066400000000000000000000005771476226662200246160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbimage.h000066400000000000000000000017121476226662200243470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbintegration.h000066400000000000000000000065151476226662200256160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbkeyboard.h000066400000000000000000000052461476226662200250730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbmime.h000066400000000000000000000024011476226662200242100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbnativeinterface.h000066400000000000000000000116441476226662200264410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbobject.h000066400000000000000000000013131476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbscreen.h000066400000000000000000000164751476226662200245600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbsessionmanager.h000066400000000000000000000026131476226662200263040ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263120ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260140ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbwindow.h000066400000000000000000000226221476226662200245770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbwmsupport.h000066400000000000000000000012761476226662200253520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.0/qxcbxsettings.h000066400000000000000000000020171476226662200253140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/000077500000000000000000000000001476226662200222365ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbatom.h000066400000000000000000000113231476226662200242250ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbbackingstore.h000066400000000000000000000044761476226662200257530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbclipboard.h000066400000000000000000000070661476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbconnection.h000066400000000000000000000331111476226662200254230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbconnection_basic.h000066400000000000000000000105171476226662200265710ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbcursor.h000066400000000000000000000052761476226662200246140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbdrag.h000066400000000000000000000120431476226662200242020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264550ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbeventqueue.h000066400000000000000000000072101476226662200254530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbexport.h000066400000000000000000000005771476226662200246170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbimage.h000066400000000000000000000017121476226662200243500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbintegration.h000066400000000000000000000065151476226662200256170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbkeyboard.h000066400000000000000000000052461476226662200250740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbmime.h000066400000000000000000000024011476226662200242110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbnativeinterface.h000066400000000000000000000116441476226662200264420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbobject.h000066400000000000000000000013131476226662200245310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbscreen.h000066400000000000000000000164751476226662200245610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbsessionmanager.h000066400000000000000000000026131476226662200263050ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263130ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260150ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbwindow.h000066400000000000000000000226221476226662200246000ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbwmsupport.h000066400000000000000000000012761476226662200253530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.1/qxcbxsettings.h000066400000000000000000000020171476226662200253150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/000077500000000000000000000000001476226662200222375ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbatom.h000066400000000000000000000113231476226662200242260ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbbackingstore.h000066400000000000000000000044761476226662200257540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbclipboard.h000066400000000000000000000070661476226662200252360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbconnection.h000066400000000000000000000331111476226662200254240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbconnection_basic.h000066400000000000000000000105171476226662200265720ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbcursor.h000066400000000000000000000052761476226662200246150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbdrag.h000066400000000000000000000120431476226662200242030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264560ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbeventqueue.h000066400000000000000000000072101476226662200254540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); void waitForNewEvents(unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbexport.h000066400000000000000000000005771476226662200246200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbimage.h000066400000000000000000000017121476226662200243510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbintegration.h000066400000000000000000000065151476226662200256200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbkeyboard.h000066400000000000000000000052461476226662200250750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbmime.h000066400000000000000000000024011476226662200242120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbnativeinterface.h000066400000000000000000000116441476226662200264430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbobject.h000066400000000000000000000013131476226662200245320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbscreen.h000066400000000000000000000170731476226662200245550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbsessionmanager.h000066400000000000000000000026131476226662200263060ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263140ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260160ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbwindow.h000066400000000000000000000225631476226662200246050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbwmsupport.h000066400000000000000000000012761476226662200253540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.2/qxcbxsettings.h000066400000000000000000000020171476226662200253160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/000077500000000000000000000000001476226662200222405ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbatom.h000066400000000000000000000113231476226662200242270ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbbackingstore.h000066400000000000000000000044761476226662200257550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbclipboard.h000066400000000000000000000070661476226662200252370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbconnection.h000066400000000000000000000331111476226662200254250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbconnection_basic.h000066400000000000000000000105171476226662200265730ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbcursor.h000066400000000000000000000052761476226662200246160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbdrag.h000066400000000000000000000120431476226662200242040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbeventqueue.h000066400000000000000000000074201476226662200254600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbexport.h000066400000000000000000000005771476226662200246210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbimage.h000066400000000000000000000017121476226662200243520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbintegration.h000066400000000000000000000065151476226662200256210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbkeyboard.h000066400000000000000000000052461476226662200250760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbmime.h000066400000000000000000000024011476226662200242130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbnativeinterface.h000066400000000000000000000116441476226662200264440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbobject.h000066400000000000000000000013131476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbscreen.h000066400000000000000000000170731476226662200245560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbsessionmanager.h000066400000000000000000000026131476226662200263070ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263150ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260170ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbwindow.h000066400000000000000000000225631476226662200246060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbwmsupport.h000066400000000000000000000012761476226662200253550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.3/qxcbxsettings.h000066400000000000000000000020171476226662200253170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/000077500000000000000000000000001476226662200222415ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbatom.h000066400000000000000000000113231476226662200242300ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbbackingstore.h000066400000000000000000000044761476226662200257560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbclipboard.h000066400000000000000000000070661476226662200252400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbconnection.h000066400000000000000000000331111476226662200254260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbconnection_basic.h000066400000000000000000000105171476226662200265740ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbcursor.h000066400000000000000000000052761476226662200246170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbdrag.h000066400000000000000000000120431476226662200242050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbeventqueue.h000066400000000000000000000073661476226662200254720ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbexport.h000066400000000000000000000005771476226662200246220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbimage.h000066400000000000000000000017121476226662200243530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbintegration.h000066400000000000000000000065151476226662200256220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbkeyboard.h000066400000000000000000000052461476226662200250770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbmime.h000066400000000000000000000024011476226662200242140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbnativeinterface.h000066400000000000000000000116441476226662200264450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbobject.h000066400000000000000000000013131476226662200245340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbscreen.h000066400000000000000000000171111476226662200245500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbsessionmanager.h000066400000000000000000000026131476226662200263100ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263160ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260200ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbwindow.h000066400000000000000000000225631476226662200246070ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbwmsupport.h000066400000000000000000000012761476226662200253560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.4/qxcbxsettings.h000066400000000000000000000020171476226662200253200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/000077500000000000000000000000001476226662200222425ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbatom.h000066400000000000000000000113231476226662200242310ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbbackingstore.h000066400000000000000000000044761476226662200257570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbclipboard.h000066400000000000000000000070661476226662200252410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbconnection.h000066400000000000000000000331111476226662200254270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbconnection_basic.h000066400000000000000000000105171476226662200265750ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbcursor.h000066400000000000000000000052761476226662200246200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbdrag.h000066400000000000000000000120431476226662200242060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbeventdispatcher.h000066400000000000000000000040511476226662200264610ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbeventqueue.h000066400000000000000000000073661476226662200254730ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbexport.h000066400000000000000000000005771476226662200246230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbimage.h000066400000000000000000000017121476226662200243540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbintegration.h000066400000000000000000000065151476226662200256230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbkeyboard.h000066400000000000000000000052461476226662200251000ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbmime.h000066400000000000000000000024011476226662200242150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbnativeinterface.h000066400000000000000000000116441476226662200264460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbobject.h000066400000000000000000000013131476226662200245350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbscreen.h000066400000000000000000000172021476226662200245520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbsessionmanager.h000066400000000000000000000026131476226662200263110ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbsystemtraytracker.h000066400000000000000000000025351476226662200270760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbvulkaninstance.h000066400000000000000000000020721476226662200263170ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbvulkanwindow.h000066400000000000000000000010631476226662200260210ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbwindow.h000066400000000000000000000225631476226662200246100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbwmsupport.h000066400000000000000000000012761476226662200253570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.5/qxcbxsettings.h000066400000000000000000000020171476226662200253210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/000077500000000000000000000000001476226662200222435ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbatom.h000066400000000000000000000147331476226662200242420ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbbackingstore.h000066400000000000000000000101011476226662200257360ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbclipboard.h000066400000000000000000000124711476226662200252360ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbconnection.h000066400000000000000000000365141476226662200254420ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbconnection_basic.h000066400000000000000000000141271476226662200265770ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbcursor.h000066400000000000000000000107011476226662200246060ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbdrag.h000066400000000000000000000154531476226662200242170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbeventdispatcher.h000066400000000000000000000074611476226662200264720ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbeventqueue.h000066400000000000000000000127761476226662200254750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbexport.h000066400000000000000000000042021476226662200246110ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbimage.h000066400000000000000000000053151476226662200243600ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbintegration.h000066400000000000000000000121201476226662200256110ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbkeyboard.h000066400000000000000000000106511476226662200250750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbmime.h000066400000000000000000000060041476226662200242210ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbnativeinterface.h000066400000000000000000000152471476226662200264520ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbobject.h000066400000000000000000000047161476226662200245500ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbscreen.h000066400000000000000000000226051476226662200245560ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbsessionmanager.h000066400000000000000000000062211476226662200263110ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbsystemtraytracker.h000066400000000000000000000061401476226662200270730ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbvulkaninstance.h000066400000000000000000000054711476226662200263260ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbvulkanwindow.h000066400000000000000000000044661476226662200260340ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbwindow.h000066400000000000000000000266731476226662200246170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum Task { Map, Unmap, SetGeometry, SetWindowFlags, SetWindowState }; QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; bool shouldDeferTask(Task task); void handleDeferredTasks(); void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; bool m_wmStateValid = true; QVector m_deferredTasks; bool m_isWmManagedWindow = true; QRect m_deferredGeometry; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbwmsupport.h000066400000000000000000000047001476226662200253530ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.6/qxcbxsettings.h000066400000000000000000000054221476226662200253250ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/000077500000000000000000000000001476226662200222445ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbatom.h000066400000000000000000000147331476226662200242430ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbbackingstore.h000066400000000000000000000101011476226662200257370ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbclipboard.h000066400000000000000000000124711476226662200252370ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbconnection.h000066400000000000000000000365141476226662200254430ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); bool xi2MouseEventsDisabled() const; Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { QTouchDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QVector valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash m_scrollingDevices; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice); ScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QVector m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbconnection_basic.h000066400000000000000000000141271476226662200266000ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbcursor.h000066400000000000000000000107011476226662200246070ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbdrag.h000066400000000000000000000154531476226662200242200ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QVector &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; QVector current_actions; QVector drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbeventdispatcher.h000066400000000000000000000074611476226662200264730ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; // Maybe some user code depends on deprecated QUnixEventDispatcherQPA:: // hasPendingEvents() / flush() implementation, so keep it around until // Qt 6. These methods are deprecated in QAbstractEventDispatcher. bool hasPendingEvents() override; // ### Qt 6 remove void flush() override; // ### Qt 6 remove private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbeventqueue.h000066400000000000000000000127761476226662200254760ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { PeekDefault = 0, // see qx11info_x11.h for docs PeekFromCachedIndex = 1, PeekRetainMatch = 2, PeekRemoveMatch = 3, PeekRemoveMatchContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekRemoveMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = ULONG_MAX); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QVector m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekRemoveMatch || option == PeekRemoveMatchContinue) node->event = nullptr; if (option != PeekRemoveMatchContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbexport.h000066400000000000000000000042021476226662200246120ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbimage.h000066400000000000000000000053151476226662200243610ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbintegration.h000066400000000000000000000121201476226662200256120ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasDefaultConnection() const { return !m_connections.isEmpty(); } QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbkeyboard.h000066400000000000000000000106511476226662200250760ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbmime.h000066400000000000000000000060041476226662200242220ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbnativeinterface.h000066400000000000000000000152471476226662200264530ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbobject.h000066400000000000000000000047161476226662200245510ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbscreen.h000066400000000000000000000226051476226662200245570ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); }; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbsessionmanager.h000066400000000000000000000062211476226662200263120ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbsystemtraytracker.h000066400000000000000000000061401476226662200270740ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbvulkaninstance.h000066400000000000000000000054711476226662200263270ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbvulkanwindow.h000066400000000000000000000044661476226662200260350ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbwindow.h000066400000000000000000000266731476226662200246200ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum Task { Map, Unmap, SetGeometry, SetWindowFlags, SetWindowState }; QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; bool shouldDeferTask(Task task); void handleDeferredTasks(); void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; bool m_wmStateValid = true; QVector m_deferredTasks; bool m_isWmManagedWindow = true; QRect m_deferredGeometry; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QVector qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbwmsupport.h000066400000000000000000000047001476226662200253540ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.15.7/qxcbxsettings.h000066400000000000000000000054221476226662200253260ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/000077500000000000000000000000001476226662200221525ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/LICENSE000066400000000000000000001045051476226662200231640ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qglxintegration.h000066400000000000000000000032031476226662200255400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *xd, const QSurfaceFormat &format, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } static bool supportsThreading(); static void queryDummyContext(); private: QXcbScreen *m_screen; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbbackingstore.h000066400000000000000000000020201476226662200256460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; bool m_syncingResize; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbclipboard.h000066400000000000000000000052511476226662200251430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbconnection.h000066400000000000000000000421231476226662200253420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #ifdef XCB_USE_XINPUT2_MAEMO struct XInput2MaemoData; #elif XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2DeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, #if XCB_USE_MAEMO_WINDOW_PROPERTIES MeegoTouchOrientationAngle, #endif _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreen() const { return m_primaryScreen; } inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #ifdef XCB_USE_XINPUT2_MAEMO bool isUsingXInput2Maemo(); #elif defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void flush() { xcb_flush(m_connection); } void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); #ifdef XCB_USE_XINPUT2_MAEMO void initializeXInput2Maemo(); void finalizeXInput2Maemo(); void handleGenericEventMaemo(xcb_ge_event_t *event); #endif void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); XInput2DeviceData *deviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), down(false), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; bool down; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0), maxVal(0) { } double minVal; double maxVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(const TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreen; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #ifdef XCB_USE_XINPUT2_MAEMO XInput2MaemoData *m_xinputData; #elif defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; bool debug_xinput_devices; bool debug_xinput; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbcursor.h000066400000000000000000000040571476226662200245240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbdrag.h000066400000000000000000000071211476226662200241170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag(); void cancel(); void move(const QMouseEvent *me); void drop(const QMouseEvent *me); void endDrag(); void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbeglsurface.h000066400000000000000000000046151476226662200253270ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbimage.h000066400000000000000000000016431476226662200242670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbintegration.h000066400000000000000000000051161476226662200255270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbkeyboard.h000066400000000000000000000054441476226662200250100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event); void handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbmime.h000066400000000000000000000025551476226662200241370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QList &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbnativeinterface.h000066400000000000000000000050201476226662200263450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_genericEventFilterType; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbobject.h000066400000000000000000000013051476226662200244460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbscreen.h000066400000000000000000000060621476226662200244640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, int *value); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; QFontEngine::HintStyle m_hintStyle; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbsessionmanager.h000066400000000000000000000026001476226662200262150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbwindow.h000066400000000000000000000125461476226662200245200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); #if XCB_USE_MAEMO_WINDOW_PROPERTIES void handleContentOrientationChange(Qt::ScreenOrientation orientation); #endif bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateSyncRequestCounter(); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxcbxsettings.h000066400000000000000000000017601476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.0/qxlibconvenience.h000066400000000000000000000043641476226662200256660ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/000077500000000000000000000000001476226662200221535ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/LICENSE000066400000000000000000001045051476226662200231650ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qglxintegration.h000066400000000000000000000032031476226662200255410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *xd, const QSurfaceFormat &format, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } static bool supportsThreading(); static void queryDummyContext(); private: QXcbScreen *m_screen; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbbackingstore.h000066400000000000000000000020121476226662200256500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbclipboard.h000066400000000000000000000052511476226662200251440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbconnection.h000066400000000000000000000425351476226662200253520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #ifdef XCB_USE_XINPUT2_MAEMO struct XInput2MaemoData; #elif XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2DeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, #if XCB_USE_MAEMO_WINDOW_PROPERTIES MeegoTouchOrientationAngle, #endif _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreen() const { return m_primaryScreen; } inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #ifdef XCB_USE_XINPUT2_MAEMO bool isUsingXInput2Maemo(); #elif defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif QXcbEventReader *eventReader() const { return m_reader; } public slots: void syncWindow(QXcbWindow *window); void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); #ifdef XCB_USE_XINPUT2_MAEMO void initializeXInput2Maemo(); void finalizeXInput2Maemo(); void handleGenericEventMaemo(xcb_ge_event_t *event); #endif void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2DeviceData *deviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), down(false), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; bool down; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0), maxVal(0) { } double minVal; double maxVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(const TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreen; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #ifdef XCB_USE_XINPUT2_MAEMO XInput2MaemoData *m_xinputData; #elif defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; bool debug_xinput_devices; bool debug_xinput; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbcursor.h000066400000000000000000000040571476226662200245250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbdrag.h000066400000000000000000000071211476226662200241200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag(); void cancel(); void move(const QMouseEvent *me); void drop(const QMouseEvent *me); void endDrag(); void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbeglsurface.h000066400000000000000000000046151476226662200253300ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbimage.h000066400000000000000000000016431476226662200242700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbintegration.h000066400000000000000000000051161476226662200255300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbkeyboard.h000066400000000000000000000054441476226662200250110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(QXcbWindowEventListener *eventListener, const xcb_key_press_event_t *event); void handleKeyReleaseEvent(QXcbWindowEventListener *eventListener, const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbmime.h000066400000000000000000000025551476226662200241400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QList &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbnativeinterface.h000066400000000000000000000050201476226662200263460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_genericEventFilterType; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbobject.h000066400000000000000000000013051476226662200244470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbscreen.h000066400000000000000000000060621476226662200244650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, int *value); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; QFontEngine::HintStyle m_hintStyle; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbsessionmanager.h000066400000000000000000000026561476226662200262310ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbwindow.h000066400000000000000000000132221476226662200245110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); #if XCB_USE_MAEMO_WINDOW_PROPERTIES void handleContentOrientationChange(Qt::ScreenOrientation orientation); #endif bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif bool needsSync() const; public Q_SLOTS: void updateSyncRequestCounter(); private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbwmsupport.h000066400000000000000000000012761476226662200252700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxcbxsettings.h000066400000000000000000000017601476226662200252360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.1/qxlibconvenience.h000066400000000000000000000043641476226662200256670ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/000077500000000000000000000000001476226662200221545ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/LICENSE000066400000000000000000001045051476226662200231660ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qglxintegration.h000066400000000000000000000032011476226662200255400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *xd, const QSurfaceFormat &format, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbbackingstore.h000066400000000000000000000017661476226662200256700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbclipboard.h000066400000000000000000000052511476226662200251450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbconnection.h000066400000000000000000000427741476226662200253600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #ifdef XCB_USE_XINPUT2_MAEMO struct XInput2MaemoData; #elif XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2DeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, #if XCB_USE_MAEMO_WINDOW_PROPERTIES MeegoTouchOrientationAngle, #endif _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreen() const { return m_primaryScreen; } inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #ifdef XCB_USE_XINPUT2_MAEMO bool isUsingXInput2Maemo(); #elif defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif QXcbEventReader *eventReader() const { return m_reader; } public slots: void syncWindow(QXcbWindow *window); void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); #ifdef XCB_USE_XINPUT2_MAEMO void initializeXInput2Maemo(); void finalizeXInput2Maemo(); void handleGenericEventMaemo(xcb_ge_event_t *event); #endif void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2DeviceData *deviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), down(false), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; bool down; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreen; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #ifdef XCB_USE_XINPUT2_MAEMO XInput2MaemoData *m_xinputData; #elif defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; bool debug_xinput_devices; bool debug_xinput; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbcursor.h000066400000000000000000000040571476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbdrag.h000066400000000000000000000071211476226662200241210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag(); void cancel(); void move(const QMouseEvent *me); void drop(const QMouseEvent *me); void endDrag(); void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbeglsurface.h000066400000000000000000000046151476226662200253310ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbexport.h000066400000000000000000000005771476226662200245350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbimage.h000066400000000000000000000016431476226662200242710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbintegration.h000066400000000000000000000051161476226662200255310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbkeyboard.h000066400000000000000000000053361476226662200250120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbmime.h000066400000000000000000000025551476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QList &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbnativeinterface.h000066400000000000000000000050201476226662200263470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_genericEventFilterType; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbobject.h000066400000000000000000000013051476226662200244500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbscreen.h000066400000000000000000000060621476226662200244660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, int *value); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; QFontEngine::HintStyle m_hintStyle; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbsessionmanager.h000066400000000000000000000026001476226662200262170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbwindow.h000066400000000000000000000132221476226662200245120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); #if XCB_USE_MAEMO_WINDOW_PROPERTIES void handleContentOrientationChange(Qt::ScreenOrientation orientation); #endif bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif bool needsSync() const; public Q_SLOTS: void updateSyncRequestCounter(); private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbwmsupport.h000066400000000000000000000012761476226662200252710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxcbxsettings.h000066400000000000000000000017601476226662200252370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.3.2/qxlibconvenience.h000066400000000000000000000043641476226662200256700ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/000077500000000000000000000000001476226662200221535ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/LICENSE000066400000000000000000001045051476226662200231650ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qglxintegration.h000066400000000000000000000037431476226662200255520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } QVariant nativeHandle() const; static bool supportsThreading(); static void queryDummyContext(); private: void init(QXcbScreen *screen, QPlatformOpenGLContext *share); void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle); Display *m_display; GLXFBConfig m_config; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; bool m_ownsContext; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbbackingstore.h000066400000000000000000000020531476226662200256550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbclipboard.h000066400000000000000000000052511476226662200251440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbconnection.h000066400000000000000000000431751476226662200253530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif QXcbEventReader *eventReader() const { return m_reader; } protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; uint32_t glx_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbcursor.h000066400000000000000000000040571476226662200245250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbdrag.h000066400000000000000000000071021476226662200241170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag(); void cancel(); void move(const QMouseEvent *me); void drop(const QMouseEvent *me); void endDrag(); void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbeglsurface.h000066400000000000000000000040301476226662200253170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbimage.h000066400000000000000000000016431476226662200242700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbintegration.h000066400000000000000000000051161476226662200255300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbkeyboard.h000066400000000000000000000056101476226662200250040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbmime.h000066400000000000000000000025611476226662200241350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbnativeinterface.h000066400000000000000000000065321476226662200263570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, EglConfig, GLXConfig, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void clearRegion(const QWindow *qwindow, const QRect& rect); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbobject.h000066400000000000000000000013051476226662200244470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbscreen.h000066400000000000000000000067331476226662200244720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; qreal devicePixelRatio() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_devicePixelRatio; QFontEngine::HintStyle m_hintStyle; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbsessionmanager.h000066400000000000000000000026561476226662200262310ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbwindow.h000066400000000000000000000140221476226662200245100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QXcbSyncWindowRequest; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types); bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } qreal devicePixelRatio() const; public Q_SLOTS: void updateSyncRequestCounter(); private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxcbxsettings.h000066400000000000000000000020061476226662200252300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.0/qxlibconvenience.h000066400000000000000000000035771476226662200256740ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/000077500000000000000000000000001476226662200221545ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/LICENSE000066400000000000000000001045051476226662200231660ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qglxintegration.h000066400000000000000000000037431476226662200255530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } QVariant nativeHandle() const; static bool supportsThreading(); static void queryDummyContext(); private: void init(QXcbScreen *screen, QPlatformOpenGLContext *share); void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle); Display *m_display; GLXFBConfig m_config; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; bool m_ownsContext; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbbackingstore.h000066400000000000000000000020531476226662200256560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbclipboard.h000066400000000000000000000052511476226662200251450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbconnection.h000066400000000000000000000432621476226662200253510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; uint32_t glx_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbcursor.h000066400000000000000000000040571476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbdrag.h000066400000000000000000000073021476226662200241220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QMouseEvent *me) Q_DECL_OVERRIDE; void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbeglsurface.h000066400000000000000000000040301476226662200253200ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbimage.h000066400000000000000000000016431476226662200242710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbintegration.h000066400000000000000000000051421476226662200255300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbkeyboard.h000066400000000000000000000056101476226662200250050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbmime.h000066400000000000000000000025611476226662200241360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbnativeinterface.h000066400000000000000000000065611476226662200263620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, EglConfig, GLXConfig, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void clearRegion(const QWindow *qwindow, const QRect& rect); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbobject.h000066400000000000000000000013051476226662200244500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbscreen.h000066400000000000000000000072561476226662200244740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect nativeGeometry() const { return m_nativeGeometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; qreal devicePixelRatio() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_nativeGeometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_devicePixelRatio; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbsessionmanager.h000066400000000000000000000026001476226662200262170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbwindow.h000066400000000000000000000141411476226662200245130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QXcbSyncWindowRequest; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types); bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } qreal devicePixelRatio() const; QPlatformScreen *screenForNativeGeometry(const QRect &newGeometry) const; public Q_SLOTS: void updateSyncRequestCounter(); private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbwmsupport.h000066400000000000000000000012751476226662200252700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxcbxsettings.h000066400000000000000000000020061476226662200252310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.1/qxlibconvenience.h000066400000000000000000000035771476226662200256750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/000077500000000000000000000000001476226662200221555ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/LICENSE000066400000000000000000001045051476226662200231670ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qglxintegration.h000066400000000000000000000037431476226662200255540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext { public: QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); void (*getProcAddress(const QByteArray &procName)) (); QSurfaceFormat format() const; bool isSharing() const; bool isValid() const; GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } QVariant nativeHandle() const; static bool supportsThreading(); static void queryDummyContext(); private: void init(QXcbScreen *screen, QPlatformOpenGLContext *share); void init(QXcbScreen *screen, QPlatformOpenGLContext *share, const QVariant &nativeHandle); Display *m_display; GLXFBConfig m_config; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; int m_swapInterval; bool m_ownsContext; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const { return m_format; } bool isValid() const { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QSurfaceFormat m_format; QXcbScreen *m_screen; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbbackingstore.h000066400000000000000000000020531476226662200256570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground); #endif QImage toImage() const; void resize(const QSize &size, const QRegion &staticContents); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &); private: QXcbShmImage *m_image; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbclipboard.h000066400000000000000000000052511476226662200251460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode); void setMimeData(QMimeData *data, QClipboard::Mode mode); bool supportsMode(QClipboard::Mode mode) const; bool ownsMode(QClipboard::Mode mode) const; QXcbScreen *screen() const { return m_screen; } xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; QXcbScreen *m_screen; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbconnection.h000066400000000000000000000436001476226662200253460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run(); QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif #ifdef XCB_USE_EGL bool hasEgl() const; #endif #if defined(XCB_USE_EGL) void *egl_display() const { return m_egl_display; } #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isUsingXInput21() { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isUsingXInput21() { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); Qt::MouseButtons buttons() const { return m_buttons; } QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeGLX(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findOrCreateScreen(QList& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); void handleMotionNotify(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; #endif // XCB_USE_XINPUT2 #if defined(XCB_USE_XINPUT2) static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #if defined(XCB_USE_EGL) void *m_egl_display; bool m_has_egl; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; uint32_t glx_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) #endif #if defined(XCB_USE_EGL) #define EGL_DISPLAY_FROM_XCB(object) ((EGLDisplay)(object->connection()->egl_display())) #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbcursor.h000066400000000000000000000040571476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget); #endif QPoint pos() const; void setPos(const QPoint &pos); static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbdrag.h000066400000000000000000000073021476226662200241230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData(); void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QMouseEvent *me) Q_DECL_OVERRIDE; void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbeglsurface.h000066400000000000000000000040301476226662200253210ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLSURFACE_H #define QXCBEGLSURFACE_H #include QT_BEGIN_NAMESPACE class QXcbEGLSurface { public: QXcbEGLSurface(EGLDisplay display, EGLSurface surface) : m_display(display) , m_surface(surface) { } ~QXcbEGLSurface() { eglDestroySurface(m_display, m_surface); } EGLSurface surface() const { return m_surface; } private: EGLDisplay m_display; EGLSurface m_surface; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbimage.h000066400000000000000000000016431476226662200242720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbintegration.h000066400000000000000000000051421476226662200255310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; bool hasCapability(Capability cap) const; QAbstractEventDispatcher *createEventDispatcher() const; void initialize(); void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface()const; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const; #endif QPlatformInputContext *inputContext() const; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const; #endif QPlatformServices *services() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; QList possibleKeys(const QKeyEvent *e) const; QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QVariant styleHint(StyleHint hint) const; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync(); private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbkeyboard.h000066400000000000000000000056101476226662200250060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbmime.h000066400000000000000000000025611476226662200241370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbnativeinterface.h000066400000000000000000000065611476226662200263630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, EglDisplay, Connection, Screen, EglContext, EglConfig, GLXConfig, GLXContext, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *eglDisplayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void clearRegion(const QWindow *qwindow, const QRect& rect); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbobject.h000066400000000000000000000013051476226662200244510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbscreen.h000066400000000000000000000072561476226662200244750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; class QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, xcb_randr_get_output_info_reply_t *output, QString outputName, int number); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const; QWindow *topLevelAt(const QPoint &point) const; QRect geometry() const { return m_geometry; } QRect nativeGeometry() const { return m_nativeGeometry; } QRect availableGeometry() const {return m_availableGeometry;} int depth() const { return m_screen->root_depth; } QImage::Format format() const; QSizeF physicalSize() const { return m_sizeMillimeters; } QDpi logicalDpi() const; qreal devicePixelRatio() const; QPlatformCursor *cursor() const; qreal refreshRate() const { return m_refreshRate; } Qt::ScreenOrientation orientation() const { return m_orientation; } QList virtualSiblings() const { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } int screenNumber() const { return m_number; } xcb_screen_t *screen() const { return m_screen; } xcb_window_t root() const { return m_screen->root; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(xcb_timestamp_t timestamp); void updateRefreshRate(); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; xcb_screen_t *m_screen; xcb_randr_crtc_t m_crtc; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_nativeGeometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; int m_number; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_devicePixelRatio; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; QXcbXSettings *m_xSettings; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbsessionmanager.h000066400000000000000000000026561476226662200262330ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbsystemtraytracker.h000066400000000000000000000026041476226662200270060ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbwindow.h000066400000000000000000000141411476226662200245140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QXcbSyncWindowRequest; class QIcon; class QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect); QMargins frameMargins() const; void setVisible(bool visible); void setWindowFlags(Qt::WindowFlags flags); void setWindowState(Qt::WindowState state); WId winId() const; void setParent(const QPlatformWindow *window); bool isExposed() const; bool isEmbedded(const QPlatformWindow *parentWindow) const; QPoint mapToGlobal(const QPoint &pos) const; QPoint mapFromGlobal(const QPoint &pos) const; void setWindowTitle(const QString &title); void setWindowIcon(const QIcon &icon); void raise(); void lower(); void propagateSizeHints(); void requestActivateWindow(); bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const; void windowEvent(QEvent *event); bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); void setMask(const QRegion ®ion); void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; #endif static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types); bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } qreal devicePixelRatio() const; QPlatformScreen *screenForNativeGeometry(const QRect &newGeometry) const; public Q_SLOTS: void updateSyncRequestCounter(); private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void create(); void destroy(); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); QXcbScreen *m_screen; xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbwmsupport.h000066400000000000000000000012761476226662200252720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxcbxsettings.h000066400000000000000000000020061476226662200252320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbScreen *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbScreen *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.4.2/qxlibconvenience.h000066400000000000000000000035771476226662200256760ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/000077500000000000000000000000001476226662200221545ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/LICENSE000066400000000000000000001045051476226662200231660ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbbackingstore.h000066400000000000000000000024711476226662200256620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QRegion m_paintRegion; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbclipboard.h000066400000000000000000000052721476226662200251500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbconnection.h000066400000000000000000000461021476226662200253450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); XcbPollForQueuedEventFunctionPointer m_xcb_poll_for_queued_event; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } bool xi2MouseEvents() const; protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId = XCB_NONE, xcb_randr_get_output_info_reply_t *output = 0); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void initializeScreens(); void updateScreens(const xcb_randr_notify_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData, QXcbWindowEventListener *eventListener); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchPoints; QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbcursor.h000066400000000000000000000041471476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbdrag.h000066400000000000000000000073421476226662200241260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QMouseEvent *me) Q_DECL_OVERRIDE; void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbexport.h000066400000000000000000000005771476226662200245350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbimage.h000066400000000000000000000016431476226662200242710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbintegration.h000066400000000000000000000061551476226662200255350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbkeyboard.h000066400000000000000000000057161476226662200250140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbmime.h000066400000000000000000000025611476226662200241360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbnativeinterface.h000066400000000000000000000113471476226662200263600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(const QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbobject.h000066400000000000000000000013051476226662200244500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbscreen.h000066400000000000000000000133631476226662200244700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QXcbXSettings *xSettings() const; private: xcb_screen_t *m_screen; int m_number; QXcbXSettings *m_xSettings; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, QString outputName); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect nativeGeometry() const { return m_nativeGeometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal devicePixelRatio() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } void removeVirtualSibling(QPlatformScreen *s) { m_siblings.removeOne(s); } void addVirtualSibling(QPlatformScreen *s) { ((QXcbScreen *) s)->isPrimary() ? m_siblings.prepend(s) : m_siblings.append(s); } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } xcb_window_t clientLeader() const { return m_clientLeader; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; QPoint mapToNative(const QPoint &pos) const; QPoint mapFromNative(const QPoint &pos) const; QRect mapToNative(const QRect &rect) const; QRect mapFromNative(const QRect &rect) const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_nativeGeometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; xcb_window_t m_clientLeader; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_devicePixelRatio; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbsessionmanager.h000066400000000000000000000026001476226662200262170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbsystemtraytracker.h000066400000000000000000000026241476226662200270070ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbwindow.h000066400000000000000000000174111476226662200245160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; void handleXIMouseEvent(xcb_ge_event_t *) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } qreal devicePixelRatio() const Q_DECL_OVERRIDE; QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); void maybeSetScreen(QXcbScreen *screen); QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat() { m_format = window()->requestedFormat(); } virtual void *createVisual() { return Q_NULLPTR; } virtual bool supportsSyncProtocol() { return !window()->supportsOpenGL(); } QPoint mapToNative(const QPoint &pos, const QXcbScreen *screen) const; QPoint mapFromNative(const QPoint &pos, const QXcbScreen *screen) const; QRect mapToNative(const QRect &rect, const QXcbScreen *screen) const; QRect mapFromNative(const QRect &rect, const QXcbScreen *screen) const; QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); xcb_window_t m_window; QXcbScreen *m_xcbScreen; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxcbxsettings.h000066400000000000000000000020261476226662200252330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.0/qxlibconvenience.h000066400000000000000000000035601476226662200256650ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/000077500000000000000000000000001476226662200221555ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/LICENSE000066400000000000000000001045051476226662200231670ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbbackingstore.h000066400000000000000000000024711476226662200256630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; QXcbShmImage *m_image; private: QRegion m_paintRegion; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbclipboard.h000066400000000000000000000052721476226662200251510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbconnection.h000066400000000000000000000456671476226662200253650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } bool xi2MouseEvents() const; protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId = XCB_NONE, xcb_randr_get_output_info_reply_t *output = 0); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void initializeScreens(); void updateScreens(const xcb_randr_notify_event_t *event); bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData, QXcbWindowEventListener *eventListener); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbcursor.h000066400000000000000000000041471476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #ifdef XCB_USE_XLIB static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbdrag.h000066400000000000000000000073421476226662200241270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QMouseEvent; class QWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QMouseEvent *me) Q_DECL_OVERRIDE; void drop(const QMouseEvent *me) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QWindow *window, const xcb_client_message_event_t *event); void handlePosition(QWindow *w, const xcb_client_message_event_t *event); void handleLeave(QWindow *w, const xcb_client_message_event_t *event); void handleDrop(QWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbScreen *current_screen; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbexport.h000066400000000000000000000005771476226662200245360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbimage.h000066400000000000000000000016431476226662200242720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbintegration.h000066400000000000000000000061551476226662200255360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbkeyboard.h000066400000000000000000000057161476226662200250150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbmime.h000066400000000000000000000025611476226662200241370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbnativeinterface.h000066400000000000000000000113471476226662200263610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(const QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; xcb_visualid_t m_systrayVisualId; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbobject.h000066400000000000000000000013051476226662200244510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbscreen.h000066400000000000000000000133701476226662200244670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QXcbXSettings *xSettings() const; private: xcb_screen_t *m_screen; int m_number; QXcbXSettings *m_xSettings; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, QString outputName); ~QXcbScreen(); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect nativeGeometry() const { return m_nativeGeometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal devicePixelRatio() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_siblings; } void setVirtualSiblings(QList sl) { m_siblings = sl; } void removeVirtualSibling(QPlatformScreen *s) { m_siblings.removeOne(s); } void addVirtualSibling(QPlatformScreen *s) { ((QXcbScreen *) s)->isPrimary() ? m_siblings.prepend(s) : m_siblings.append(s); } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; QPoint mapToNative(const QPoint &pos) const; QPoint mapFromNative(const QPoint &pos) const; QPointF mapToNative(const QPointF &pos) const; QPointF mapFromNative(const QPointF &pos) const; QRect mapToNative(const QRect &rect) const; QRect mapFromNative(const QRect &rect) const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_nativeGeometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; QList m_siblings; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_devicePixelRatio; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbsessionmanager.h000066400000000000000000000026561476226662200262330ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbsystemtraytracker.h000066400000000000000000000026241476226662200270100ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection, QObject *parent = 0); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbwindow.h000066400000000000000000000173531476226662200245240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; void handleXIMouseEvent(xcb_ge_event_t *) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } qreal devicePixelRatio() const Q_DECL_OVERRIDE; QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); void maybeSetScreen(QXcbScreen *screen); QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat() { m_format = window()->requestedFormat(); } virtual void *createVisual() { return Q_NULLPTR; } virtual bool supportsSyncProtocol() { return !window()->supportsOpenGL(); } QPoint mapToNative(const QPoint &pos, const QXcbScreen *screen) const; QPoint mapFromNative(const QPoint &pos, const QXcbScreen *screen) const; QRect mapToNative(const QRect &rect, const QXcbScreen *screen) const; QRect mapFromNative(const QRect &rect, const QXcbScreen *screen) const; QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); xcb_window_t m_window; QXcbScreen *m_xcbScreen; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbwmsupport.h000066400000000000000000000012761476226662200252720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxcbxsettings.h000066400000000000000000000020261476226662200252340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.5.1/qxlibconvenience.h000066400000000000000000000035601476226662200256660ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/000077500000000000000000000000001476226662200221555ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/LICENSE000066400000000000000000001045051476226662200231670ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbbackingstore.h000066400000000000000000000025131476226662200256600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QRegion m_paintRegion; QImage m_rgbImage; QSize m_size; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbclipboard.h000066400000000000000000000052721476226662200251510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbconnection.h000066400000000000000000000475131476226662200253550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT2 void handleEnterEvent(const xcb_enter_notify_event_t *); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } bool xi2MouseEvents() const; protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; bool m_xi2Enabled; int m_xi2Minor; #ifdef XCB_USE_XINPUT2 void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData, QXcbWindowEventListener *eventListener); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbcursor.h000066400000000000000000000042261476226662200245250ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbdrag.h000066400000000000000000000075031476226662200241260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbexport.h000066400000000000000000000005771476226662200245360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbimage.h000066400000000000000000000016431476226662200242720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbintegration.h000066400000000000000000000061551476226662200255360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbkeyboard.h000066400000000000000000000057161476226662200250150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbmime.h000066400000000000000000000025611476226662200241370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbnativeinterface.h000066400000000000000000000113431476226662200263550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting, AtspiBus }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbobject.h000066400000000000000000000013051476226662200244510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbscreen.h000066400000000000000000000145031476226662200244660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbsessionmanager.h000066400000000000000000000026561476226662200262330ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbwindow.h000066400000000000000000000172101476226662200245140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; void handleXIMouseEvent(xcb_ge_event_t *) Q_DECL_OVERRIDE; QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat() { m_format = window()->requestedFormat(); } virtual void *createVisual() { return Q_NULLPTR; } QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.0/qxcbxsettings.h000066400000000000000000000020261476226662200252340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/000077500000000000000000000000001476226662200221565ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/LICENSE000066400000000000000000001045051476226662200231700ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbbackingstore.h000066400000000000000000000025131476226662200256610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QRegion m_paintRegion; QImage m_rgbImage; QSize m_size; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbclipboard.h000066400000000000000000000052721476226662200251520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbconnection.h000066400000000000000000000503241476226662200253500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; #endif protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled; int m_xi2Minor; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData, QXcbWindowEventListener *eventListener); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; QXcbWindow *m_mousePressWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbcursor.h000066400000000000000000000042261476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbdrag.h000066400000000000000000000076471476226662200241400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbexport.h000066400000000000000000000005771476226662200245370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbimage.h000066400000000000000000000016431476226662200242730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbintegration.h000066400000000000000000000061551476226662200255370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbkeyboard.h000066400000000000000000000057551476226662200250210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbmime.h000066400000000000000000000025611476226662200241400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbnativeinterface.h000066400000000000000000000113431476226662200263560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting, AtspiBus }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbobject.h000066400000000000000000000013051476226662200244520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbscreen.h000066400000000000000000000146051476226662200244720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbsessionmanager.h000066400000000000000000000026561476226662200262340ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbwindow.h000066400000000000000000000205111476226662200245130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; #endif QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat() { m_format = window()->requestedFormat(); } virtual void *createVisual() { return Q_NULLPTR; } QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbwmsupport.h000066400000000000000000000012761476226662200252730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxcbxsettings.h000066400000000000000000000020261476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.1/qxlibconvenience.h000066400000000000000000000035601476226662200256670ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/LICENSE000066400000000000000000001045051476226662200231710ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbbackingstore.h000066400000000000000000000025131476226662200256620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QRegion m_paintRegion; QImage m_rgbImage; QSize m_size; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbclipboard.h000066400000000000000000000052721476226662200251530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbconnection.h000066400000000000000000000504021476226662200253460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; #endif protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled; int m_xi2Minor; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(void *event, TabletData *tabletData, QXcbWindowEventListener *eventListener); void xi2ReportTabletEvent(TabletData &tabletData, void *event); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; QXcbWindow *m_mousePressWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbcursor.h000066400000000000000000000042261476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbdrag.h000066400000000000000000000076471476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbexport.h000066400000000000000000000005771476226662200245400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbimage.h000066400000000000000000000016431476226662200242740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbintegration.h000066400000000000000000000061551476226662200255400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbkeyboard.h000066400000000000000000000057551476226662200250220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbmime.h000066400000000000000000000025611476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbnativeinterface.h000066400000000000000000000113431476226662200263570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting, AtspiBus }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE void beep(); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbobject.h000066400000000000000000000013051476226662200244530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbscreen.h000066400000000000000000000146051476226662200244730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbsessionmanager.h000066400000000000000000000026561476226662200262350ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbwindow.h000066400000000000000000000207131476226662200245200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; #endif QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat() { m_format = window()->requestedFormat(); } virtual void *createVisual() { return Q_NULLPTR; } QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbwmsupport.h000066400000000000000000000012761476226662200252740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxcbxsettings.h000066400000000000000000000020261476226662200252360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.6.2/qxlibconvenience.h000066400000000000000000000035601476226662200256700ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/000077500000000000000000000000001476226662200221565ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/LICENSE000066400000000000000000001045051476226662200231700ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbbackingstore.h000066400000000000000000000025331476226662200256630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbclipboard.h000066400000000000000000000052721476226662200251520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QXcbClipboardMime *m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbconnection.h000066400000000000000000000511771476226662200253570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; #endif protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled; int m_xi2Minor; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; QXcbWindow *m_mousePressWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbcursor.h000066400000000000000000000044651476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbdrag.h000066400000000000000000000076471476226662200241400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbexport.h000066400000000000000000000005771476226662200245370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbimage.h000066400000000000000000000016431476226662200242730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbintegration.h000066400000000000000000000062251476226662200255350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; void beep() const Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbkeyboard.h000066400000000000000000000057551476226662200250210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbmime.h000066400000000000000000000025611476226662200241400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbnativeinterface.h000066400000000000000000000115441476226662200263610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) Q_DECL_OVERRIDE; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbobject.h000066400000000000000000000013051476226662200244520ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbscreen.h000066400000000000000000000150401476226662200244640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbsessionmanager.h000066400000000000000000000026561476226662200262340ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbwindow.h000066400000000000000000000206071476226662200245210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; #endif QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxcbxsettings.h000066400000000000000000000020261476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.0/qxlibconvenience.h000066400000000000000000000035601476226662200256670ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef XLIBUTILS_H #define XLIBUTILS_H #ifdef XCB_USE_XLIB #include #include QT_BEGIN_NAMESPACE xcb_keysym_t q_XLookupString(void *display, xcb_window_t window, xcb_window_t root, uint state, xcb_keycode_t code, int type, QByteArray *chars); QT_END_NAMESPACE #endif // XCB_USE_XLIB #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/LICENSE000066400000000000000000001045051476226662200231710ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbbackingstore.h000066400000000000000000000025331476226662200256640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; QImage toImage() const Q_DECL_OVERRIDE; #endif QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbclipboard.h000066400000000000000000000053111476226662200251450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbconnection.h000066400000000000000000000512551476226662200253550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #ifndef QT_NO_XKB #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); xcb_generic_event_t *checkEvent(int type); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; #endif protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled; int m_xi2Minor; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; QXcbWindow *m_mousePressWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbcursor.h000066400000000000000000000044651476226662200245340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbdrag.h000066400000000000000000000076471476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbexport.h000066400000000000000000000005771476226662200245400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbimage.h000066400000000000000000000016431476226662200242740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbintegration.h000066400000000000000000000062251476226662200255360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; void beep() const Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbkeyboard.h000066400000000000000000000060731476226662200250140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #ifndef QT_NO_XKB #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #ifndef QT_NO_XKB // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbmime.h000066400000000000000000000025611476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbnativeinterface.h000066400000000000000000000115441476226662200263620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class QDBusMenuConnection; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, NoFontHinting, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) Q_DECL_OVERRIDE; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbobject.h000066400000000000000000000013051476226662200244530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbscreen.h000066400000000000000000000150401476226662200244650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbsessionmanager.h000066400000000000000000000026561476226662200262350ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbwindow.h000066400000000000000000000211411476226662200245140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; #endif QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; xcb_cursor_t m_currentBitmapCursor; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbwmsupport.h000066400000000000000000000012761476226662200252740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.7.1/qxcbxsettings.h000066400000000000000000000020261476226662200252360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/LICENSE000066400000000000000000001045051476226662200231710ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbbackingstore.h000066400000000000000000000025331476226662200256640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) Q_DECL_OVERRIDE; #endif QImage toImage() const Q_DECL_OVERRIDE; QPlatformGraphicsBuffer *graphicsBuffer() const Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE; void beginPaint(const QRegion &) Q_DECL_OVERRIDE; void endPaint() Q_DECL_OVERRIDE; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbclipboard.h000066400000000000000000000053111476226662200251450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) Q_DECL_OVERRIDE; void setMimeData(QMimeData *data, QClipboard::Mode mode) Q_DECL_OVERRIDE; bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor; xcb_window_t m_owner; static const int clipboard_timeout; bool m_incr_active; bool m_clipboard_closing; xcb_timestamp_t m_incr_receive_time; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbconnection.h000066400000000000000000000520051476226662200253470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() Q_DECL_OVERRIDE; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QXcbWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; #endif protected: bool event(QEvent *e) Q_DECL_OVERRIDE; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled; int m_xi2Minor; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer), tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { } int deviceId; QTabletEvent::PointerType pointerType; QTabletEvent::TabletDevice tool; Qt::MouseButtons buttons; qint64 serialId; bool inProximity; struct ValuatorClassInfo { ValuatorClassInfo() : minVal(0.), maxVal(0.), curVal(0.) { } double minVal; double maxVal; double curVal; int number; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { ScrollingDevice() : deviceId(0), verticalIndex(0), horizontalIndex(0), orientations(0), legacyOrientations(0) { } int deviceId; int verticalIndex, horizontalIndex; double verticalIncrement, horizontalIncrement; Qt::Orientations orientations; Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection; const xcb_setup_t *m_setup; bool m_canGrabServer; xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; QXcbKeyboard *m_keyboard; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface; #if defined(XCB_USE_XLIB) void *m_xlib_display; #endif QXcbEventReader *m_reader; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event; uint32_t xrandr_first_event; uint32_t xkb_first_event; bool has_xinerama_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_xkb; Qt::MouseButtons m_buttons; QXcbWindow *m_focusWindow; QXcbWindow *m_mouseGrabber; QXcbWindow *m_mousePressWindow; xcb_window_t m_clientLeader; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker; QXcbGlIntegration *m_glIntegration; bool m_xiGrab; xcb_window_t m_qtSelectionOwner; friend class QXcbEventReader; }; #ifdef XCB_USE_XINPUT2 #ifndef QT_NO_TABLETEVENT Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbcursor.h000066400000000000000000000044651476226662200245340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE; #endif QPoint pos() const Q_DECL_OVERRIDE; void setPos(const QPoint &pos) Q_DECL_OVERRIDE; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbdrag.h000066400000000000000000000100131476226662200241160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); virtual QMimeData *platformDropData() Q_DECL_OVERRIDE; bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE; void startDrag() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void move(const QPoint &globalPos) Q_DECL_OVERRIDE; void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; void endDrag() Q_DECL_OVERRIDE; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const Q_DECL_OVERRIDE; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) Q_DECL_OVERRIDE; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbexport.h000066400000000000000000000005771476226662200245400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbimage.h000066400000000000000000000016431476226662200242740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbintegration.h000066400000000000000000000062251476226662200255360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; bool hasCapability(Capability cap) const Q_DECL_OVERRIDE; QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE; void initialize() Q_DECL_OVERRIDE; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE; QPlatformNativeInterface *nativeInterface()const Q_DECL_OVERRIDE; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const Q_DECL_OVERRIDE; #endif QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE; #endif QPlatformServices *services() const Q_DECL_OVERRIDE; Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE; QList possibleKeys(const QKeyEvent *e) const Q_DECL_OVERRIDE; QStringList themeNames() const Q_DECL_OVERRIDE; QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE; QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif void sync() Q_DECL_OVERRIDE; void beep() const Q_DECL_OVERRIDE; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbkeyboard.h000066400000000000000000000060761476226662200250170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config; xcb_keycode_t m_autorepeat_code; struct xkb_context *xkb_context; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbmime.h000066400000000000000000000025611476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbnativeinterface.h000066400000000000000000000114621476226662200263610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) Q_DECL_OVERRIDE; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) Q_DECL_OVERRIDE; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) Q_DECL_OVERRIDE; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) Q_DECL_OVERRIDE; QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbobject.h000066400000000000000000000013051476226662200244530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbscreen.h000066400000000000000000000147131476226662200244730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; int m_number; QList m_screens; QXcbXSettings *m_xSettings; xcb_atom_t m_net_wm_cm_atom; bool m_compositingActive; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; } QRect availableGeometry() const Q_DECL_OVERRIDE {return m_availableGeometry;} int depth() const Q_DECL_OVERRIDE { return screen()->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal pixelDensity() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; } Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE { return m_orientation; } QList virtualSiblings() const Q_DECL_OVERRIDE { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const Q_DECL_OVERRIDE { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode; bool m_primary; uint8_t m_rotation; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation; QString m_windowManagerName; bool m_syncRequestSupported; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate; int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbsessionmanager.h000066400000000000000000000027531476226662200262330ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() Q_DECL_OVERRIDE; bool allowsErrorInteraction() Q_DECL_OVERRIDE; void release() Q_DECL_OVERRIDE; void cancel() Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; bool isPhase2() const Q_DECL_OVERRIDE; void requestPhase2() Q_DECL_OVERRIDE; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbsystemtraytracker.h000066400000000000000000000025761476226662200270200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) Q_DECL_OVERRIDE; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbwindow.h000066400000000000000000000212341476226662200245170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; QMargins frameMargins() const Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; WId winId() const Q_DECL_OVERRIDE; void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; bool isExposed() const Q_DECL_OVERRIDE; bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; void raise() Q_DECL_OVERRIDE; void lower() Q_DECL_OVERRIDE; void propagateSizeHints() Q_DECL_OVERRIDE; void requestActivateWindow() Q_DECL_OVERRIDE; bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const Q_DECL_OVERRIDE; void windowEvent(QEvent *event) Q_DECL_OVERRIDE; bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; void setOpacity(qreal level) Q_DECL_OVERRIDE; void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; void setAlertState(bool enabled) Q_DECL_OVERRIDE; bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; #ifdef XCB_USE_XINPUT22 void handleXIMouseButtonState(const xcb_ge_event_t *); void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; #endif QXcbWindow *toWindow() Q_DECL_OVERRIDE; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window; uint m_depth; QImage::Format m_imageFormat; bool m_imageRgbSwap; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter; Qt::WindowState m_windowState; xcb_gravity_t m_gravity; bool m_mapped; bool m_transparent; bool m_usingSyncProtocol; bool m_deferredActivation; bool m_embedded; bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId; int m_lastWindowStateEvent; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState; QXcbSyncWindowRequest *m_pendingSyncRequest; xcb_cursor_t m_currentBitmapCursor; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.8.0/qxcbxsettings.h000066400000000000000000000020261476226662200252360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/000077500000000000000000000000001476226662200221605ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/LICENSE000066400000000000000000001045051476226662200231720ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbbackingstore.h000066400000000000000000000024341476226662200256650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbclipboard.h000066400000000000000000000053271476226662200251550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbconnection.h000066400000000000000000000534531476226662200253600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; bool isTouchScreen(int id) const; #endif protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if defined(XCB_USE_XLIB) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; Qt::MouseButtons m_buttons = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventReader; }; #ifdef XCB_USE_XINPUT2 #ifndef QT_NO_TABLETEVENT Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) (reinterpret_cast(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbcursor.h000066400000000000000000000044331476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbdrag.h000066400000000000000000000077041476226662200241340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); QMimeData *platformDropData() override; bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbexport.h000066400000000000000000000005771476226662200245410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbimage.h000066400000000000000000000016431476226662200242750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbintegration.h000066400000000000000000000061271476226662200255400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbkeyboard.h000066400000000000000000000061721476226662200250150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbmime.h000066400000000000000000000025611476226662200241420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbnativeinterface.h000066400000000000000000000113561476226662200263640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbobject.h000066400000000000000000000013051476226662200244540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbscreen.h000066400000000000000000000150631476226662200244730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override {return m_availableGeometry;} int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_forcedDpi = -1; int m_pixelDensity = 1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbsessionmanager.h000066400000000000000000000026631476226662200262340ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbwindow.h000066400000000000000000000211211476226662200245130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowState state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowState m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; int m_lastWindowStateEvent = -1; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbwmsupport.h000066400000000000000000000012761476226662200252750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.0/qxcbxsettings.h000066400000000000000000000020171476226662200252370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/000077500000000000000000000000001476226662200221615ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/LICENSE000066400000000000000000001045051476226662200231730ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbbackingstore.h000066400000000000000000000024341476226662200256660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *widget); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbclipboard.h000066400000000000000000000053271476226662200251560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbconnection.h000066400000000000000000000534531476226662200253610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #ifndef QT_NO_TABLETEVENT #include #endif #if XCB_USE_XINPUT2 #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // XCB_USE_XINPUT2 struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #ifdef XCB_USE_XLIB void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if defined(XCB_USE_XINPUT2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; bool isTouchScreen(int id) const; #endif protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #ifdef XCB_USE_XINPUT2 bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #ifndef QT_NO_TABLETEVENT struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // !QT_NO_TABLETEVENT struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if defined(XCB_USE_XLIB) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if defined(XCB_USE_XINPUT2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; Qt::MouseButtons m_buttons = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventReader; }; #ifdef XCB_USE_XINPUT2 #ifndef QT_NO_TABLETEVENT Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) (reinterpret_cast(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbcursor.h000066400000000000000000000044331476226662200245310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if defined(XCB_USE_XLIB) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbdrag.h000066400000000000000000000077041476226662200241350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); QMimeData *platformDropData() override; bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbexport.h000066400000000000000000000005771476226662200245420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbimage.h000066400000000000000000000016431476226662200242760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbintegration.h000066400000000000000000000061271476226662200255410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbkeyboard.h000066400000000000000000000061721476226662200250160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbmime.h000066400000000000000000000025611476226662200241430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbnativeinterface.h000066400000000000000000000113561476226662200263650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbobject.h000066400000000000000000000013051476226662200244550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbscreen.h000066400000000000000000000150631476226662200244740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override {return m_availableGeometry;} int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_forcedDpi = -1; int m_pixelDensity = 1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbsessionmanager.h000066400000000000000000000026631476226662200262350ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbwindow.h000066400000000000000000000216551476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowState state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowState m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; int m_lastWindowStateEvent = -1; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbwmsupport.h000066400000000000000000000012761476226662200252760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.1/qxcbxsettings.h000066400000000000000000000020171476226662200252400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/000077500000000000000000000000001476226662200221625ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbbackingstore.h000066400000000000000000000024341476226662200256670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbclipboard.h000066400000000000000000000053271476226662200251570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbconnection.h000066400000000000000000000535551476226662200253650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); void xi2SelectStateEvents(); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; bool isTouchScreen(int id) const; #endif protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #if QT_CONFIG(xinput2) bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; Qt::MouseButtons m_buttons = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) (reinterpret_cast(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbcursor.h000066400000000000000000000044311476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbdrag.h000066400000000000000000000077041476226662200241360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); QMimeData *platformDropData() override; bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbexport.h000066400000000000000000000005771476226662200245430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbimage.h000066400000000000000000000016431476226662200242770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbintegration.h000066400000000000000000000061341476226662200255400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbkeyboard.h000066400000000000000000000061721476226662200250170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbmime.h000066400000000000000000000025611476226662200241440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbnativeinterface.h000066400000000000000000000113561476226662200263660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbobject.h000066400000000000000000000013051476226662200244560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbscreen.h000066400000000000000000000150631476226662200244750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override {return m_availableGeometry;} int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_forcedDpi = -1; int m_pixelDensity = 1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbsessionmanager.h000066400000000000000000000026631476226662200262360ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbwindow.h000066400000000000000000000216551476226662200245310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowState state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowState m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; int m_lastWindowStateEvent = -1; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbwmsupport.h000066400000000000000000000012761476226662200252770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.2/qxcbxsettings.h000066400000000000000000000020171476226662200252410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/000077500000000000000000000000001476226662200221635ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbbackingstore.h000066400000000000000000000024341476226662200256700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbclipboard.h000066400000000000000000000053271476226662200251600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbconnection.h000066400000000000000000000535551476226662200253660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); void xi2SelectStateEvents(); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; bool isTouchScreen(int id) const; #endif protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #if QT_CONFIG(xinput2) bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; Qt::MouseButtons m_buttons = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) (reinterpret_cast(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbcursor.h000066400000000000000000000044311476226662200245310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbdrag.h000066400000000000000000000077041476226662200241370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); QMimeData *platformDropData() override; bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbexport.h000066400000000000000000000005771476226662200245440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbimage.h000066400000000000000000000016431476226662200243000ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbintegration.h000066400000000000000000000061341476226662200255410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbkeyboard.h000066400000000000000000000061721476226662200250200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbmime.h000066400000000000000000000025611476226662200241450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbnativeinterface.h000066400000000000000000000113561476226662200263670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbobject.h000066400000000000000000000013051476226662200244570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbscreen.h000066400000000000000000000150631476226662200244760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override {return m_availableGeometry;} int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_forcedDpi = -1; int m_pixelDensity = 1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbsessionmanager.h000066400000000000000000000026631476226662200262370ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbwindow.h000066400000000000000000000216551476226662200245320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowState state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowState m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; int m_lastWindowStateEvent = -1; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbwmsupport.h000066400000000000000000000012761476226662200253000ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.3/qxcbxsettings.h000066400000000000000000000020171476226662200252420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/000077500000000000000000000000001476226662200221645ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbbackingstore.h000066400000000000000000000024341476226662200256710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbShmImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; private: QXcbShmImage *m_image; QStack m_paintRegions; QImage m_rgbImage; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbclipboard.h000066400000000000000000000053271476226662200251610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbconnection.h000066400000000000000000000535551476226662200253670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include #include #include #include #include // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit #endif #if QT_CONFIG(tabletevent) #include #endif #if QT_CONFIG(xinput2) #include #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support #ifdef XI_TouchBeginMask #define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support #endif #endif struct XInput2TouchDeviceData; #endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; //#define Q_XCB_DEBUG QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; namespace QXcbAtom { enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionPrivate, // Motif DND _MOTIF_DRAG_AND_DROP_MESSAGE, _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS, XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms }; } typedef QVarLengthArray QXcbEventArray; class QXcbConnection; class QXcbEventReader : public QThread { Q_OBJECT public: QXcbEventReader(QXcbConnection *connection); void run() override; QXcbEventArray *lock(); void unlock(); void start(); void registerEventDispatcher(QAbstractEventDispatcher *dispatcher); signals: void eventPending(); private slots: void registerForEvents(); private: void addEvent(xcb_generic_event_t *event); QMutex m_mutex; QXcbEventArray m_events; QXcbConnection *m_connection; }; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleGenericEvent(xcb_generic_event_t *, long *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} #ifdef XCB_USE_XINPUT22 virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} #endif virtual QXcbWindow *toWindow() { return 0; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class QAbstractEventDispatcher; class Q_XCB_EXPORT QXcbConnection : public QObject { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = 0); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } bool isConnected() const; const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } int primaryScreenNumber() const { return m_primaryScreenNumber; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(m_primaryScreenNumber); } QXcbScreen *primaryScreen() const; inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); const char *displayName() const { return m_displayName.constData(); } xcb_connection_t *xcb_connection() const { return m_connection; } const xcb_setup_t *setup() const { return m_setup; } const xcb_format_t *formatForDepth(uint8_t depth) const; QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } #if QT_CONFIG(xcb_xlib) void *xlib_display() const; void *createVisualInfoForDefaultVisualId() const; #endif #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); void xi2SelectStateEvents(); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } #else bool isAtLeastXI21() const { return false; } #endif #ifdef XCB_USE_XINPUT22 bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #else bool isAtLeastXI22() const { return false; } #endif void sync(); void handleXcbError(xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); template inline xcb_generic_event_t *checkEvent(T &checker); typedef bool (*PeekFunc)(QXcbConnection *, xcb_generic_event_t *); void addPeekFunc(PeekFunc f); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } bool threadedEventHandling() const { return m_reader->isRunning(); } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; static bool xEmbedSystemTrayAvailable(); static bool xEmbedSystemTrayVisualHasAlphaChannel(); #ifdef XCB_USE_XINPUT21 void handleEnterEvent(); #endif #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); #endif Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const { return m_glIntegration; } #ifdef XCB_USE_XINPUT22 bool xi2MouseEvents() const; bool isTouchScreen(int id) const; #endif protected: bool event(QEvent *e) override; public slots: void flush() { xcb_flush(m_connection); } private slots: void processXcbEvents(); private: void initializeAllAtoms(); void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXinerama(); void initializeXShape(); void initializeXKB(); void handleClientMessageEvent(const xcb_client_message_event_t *event); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; #if QT_CONFIG(xinput2) bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); void finalizeXInput2(); void xi2SetupDevices(); XInput2TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierachyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); int m_xiOpCode, m_xiEventBase, m_xiErrorBase; #ifdef XCB_USE_XINPUT22 void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #endif // XCB_USE_XINPUT22 #if QT_CONFIG(tabletevent) struct TabletData { int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; Qt::MouseButtons buttons = 0; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QVector m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) struct ScrollingDevice { int deviceId = 0; int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations = 0; Qt::Orientations legacyOrientations = 0; QPointF lastScrollPosition; }; void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes); void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice); QHash m_scrollingDevices; static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event); #endif xcb_connection_t *m_connection = nullptr; const xcb_setup_t *m_setup = nullptr; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; int m_primaryScreenNumber = 0; xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QByteArray m_displayName; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #ifndef QT_NO_DRAGANDDROP QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; #if QT_CONFIG(xcb_xlib) void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; #if QT_CONFIG(xinput2) QHash m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { xcb_window_t window; uint16_t deviceid; uint32_t pointid; Qt::Corner corner; } m_startSystemResizeInfo; #endif #endif #ifdef Q_XCB_DEBUG struct CallInfo { int sequence; QByteArray file; int line; }; QVector m_callLog; QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); template friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line); #endif WindowMapper m_mapper; QVector m_peekFuncs; uint32_t xfixes_first_event = 0; uint32_t xrandr_first_event = 0; uint32_t xkb_first_event = 0; bool has_xinerama_extension = false; bool has_shape_extension = false; bool has_randr_extension = false; bool has_input_shape; bool has_xkb = false; Qt::MouseButtons m_buttons = 0; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; QXcbGlIntegration *m_glIntegration = nullptr; bool m_xiGrab = false; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventReader; }; #if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif #endif #define DISPLAY_FROM_XCB(object) (reinterpret_cast(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) template xcb_generic_event_t *QXcbConnection::checkEvent(T &checker) { QXcbEventArray *eventqueue = m_reader->lock(); for (int i = 0; i < eventqueue->size(); ++i) { xcb_generic_event_t *event = eventqueue->at(i); if (checker.checkEvent(event)) { (*eventqueue)[i] = 0; m_reader->unlock(); return event; } } m_reader->unlock(); return 0; } class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; template union q_padded_xcb_event { T event; char padding[32]; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. #define Q_DECLARE_XCB_EVENT(event_var, event_type) \ q_padded_xcb_event store = {}; \ auto &event_var = store.event; #ifdef Q_XCB_DEBUG template cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, cookie.sequence); return cookie; } template reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) { connection->log(file, line, reply->sequence); return reply; } #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); #else #define Q_XCB_CALL(x) x #define Q_XCB_CALL2(x, connection) x #define Q_XCB_NOOP(c) (void)c; #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbcursor.h000066400000000000000000000044311476226662200245320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *widget) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbdrag.h000066400000000000000000000100561476226662200241320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_DRAGANDDROP class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); QMimeData *platformDropData() override; bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos) override; void drop(const QPoint &globalPos) override; void endDrag() override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QVector xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QVector drag_types; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QVector transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_MOVABLE_TYPE); #endif // QT_NO_DRAGANDDROP QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbexport.h000066400000000000000000000005771476226662200245450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbimage.h000066400000000000000000000016431476226662200243010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbintegration.h000066400000000000000000000061341476226662200255420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class QXcbScreen; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #ifndef QT_NO_DRAGANDDROP QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; QXcbConnection *defaultConnection() const { return m_connections.first(); } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; static QXcbIntegration *instance() { return m_instance; } private: QList m_connections; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbkeyboard.h000066400000000000000000000061721476226662200250210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #include #if QT_CONFIG(xkb) #include #endif #include QT_BEGIN_NAMESPACE class QWindow; class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); void handleMappingNotifyEvent(const void *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(); QList possibleKeys(const QKeyEvent *e) const; // when XKEYBOARD not present on the X server void updateXKBMods(); quint32 xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); #ifdef XCB_USE_XINPUT22 void updateXKBStateFromXI(void *modInfo, void *groupInfo); #endif #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); #endif protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); void resolveMaskConflicts(); QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const; void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); // when XKEYBOARD not present on the X server void updateModifiers(); // when XKEYBOARD is present on the X server void updateVModMapping(); void updateVModToRModMapping(); xkb_keysym_t lookupLatinKeysym(xkb_keycode_t keycode) const; void checkForLatinLayout(); private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; struct xkb_keymap *xkb_keymap = nullptr; struct xkb_state *xkb_state = nullptr; struct xkb_rule_names xkb_names; mutable struct xkb_keymap *latin_keymap = nullptr; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; #if QT_CONFIG(xkb) // when XKEYBOARD is present on the X server _mod_masks vmod_masks; int core_device_id; #endif bool m_hasLatinLayout = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbmime.h000066400000000000000000000025611476226662200241460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QVector mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QVariant::Type requestedType, const QVector &atoms, QByteArray *requestedEncoding); }; #endif // !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbnativeinterface.h000066400000000000000000000113561476226662200263700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; class QXcbConnection; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface { Q_OBJECT public: enum ResourceType { Display, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); void *display(); void *atspiBus(); void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const; Q_INVOKABLE void setParentRelativeBackPixmap(QWindow *window); Q_INVOKABLE bool systrayVisualHasAlphaChannel(); Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window); Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window); void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen); const QByteArray m_genericEventFilterType; xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbobject.h000066400000000000000000000013051476226662200244600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbscreen.h000066400000000000000000000150631476226662200244770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList sl) { m_screens = sl; } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; QRect workArea() const { return m_workArea; } void updateWorkArea(); void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); private: QRect getWorkArea() const; xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override {return m_availableGeometry;} int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QSizeF physicalSize() const override { return m_sizeMillimeters; } QSize virtualSize() const { return m_virtualSize; } QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi virtualDpi() const; QDpi logicalDpi() const override; qreal pixelDensity() const override; QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } static int virtualDesktopNumberStatic(const QScreen *screen); xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_windowManagerName; } bool syncRequestSupported() const { return m_syncRequestSupported; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; QString name() const override { return m_outputName; } void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); void updateGeometry(const QRect &geom, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QXcbXSettings *xSettings() const; private: static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void sendStartupMessage(const QByteArray &message) const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QSize m_virtualSize; QSizeF m_virtualSizeMillimeters; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QString m_windowManagerName; bool m_syncRequestSupported = false; QMap m_visuals; QMap m_visualDepths; QXcbCursor *m_cursor; int m_refreshRate = 60; int m_forcedDpi = -1; int m_pixelDensity = 1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbsessionmanager.h000066400000000000000000000026631476226662200262400ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; Q_DISABLE_COPY(QXcbSessionManager) }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbsystemtraytracker.h000066400000000000000000000025731476226662200270220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; QRect systemTrayWindowGlobalGeometry(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; bool visualHasAlphaChannel(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbwindow.h000066400000000000000000000216551476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include "qxcbobject.h" #include QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowState state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); QSurfaceFormat format() const override; void windowEvent(QEvent *event) override; bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; #endif QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); static void setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmWindowTypes windowTypes); static void setWmWindowRoleStatic(QWindow *window, const QByteArray &role); static uint visualIdStatic(QWindow *window); QXcbWindowFunctions::WmWindowTypes wmWindowTypes() const; void setWmWindowType(QXcbWindowFunctions::WmWindowTypes types, Qt::WindowFlags flags); void setWmWindowRole(const QByteArray &role); static void setWindowIconTextStatic(QWindow *window, const QString &text); static void setParentRelativeBackPixmapStatic(QWindow *window); void setParentRelativeBackPixmap(); static bool requestSystemTrayWindowDockStatic(const QWindow *window); bool requestSystemTrayWindowDock() const; static QRect systemTrayWindowGlobalGeometryStatic(const QWindow *window); QRect systemTrayWindowGlobalGeometry() const; uint visualId() const; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = 0; } QXcbScreen *xcbScreen() const; bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); virtual void create(); virtual void destroy(); public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); NetWmStates netWmStates(); void setNetWmStates(NetWmStates); void setMotifWindowFlags(Qt::WindowFlags flags); void setNetWmStateWindowFlags(Qt::WindowFlags flags); void updateMotifWmHintsBeforeMap(); void updateNetWmStateBeforeMap(); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); QRect windowToWmGeometry(QRect r) const; void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); bool compressExposeEvent(QRegion &exposeRegion); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; xcb_colormap_t m_cmap = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowState m_windowState = Qt::WindowNoState; xcb_gravity_t m_gravity = XCB_GRAVITY_STATIC; bool m_mapped = false; bool m_transparent = false; bool m_usingSyncProtocol = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; xcb_visualid_t m_visualId = 0; int m_lastWindowStateEvent = -1; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbwmsupport.h000066400000000000000000000012761476226662200253010ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QVector &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QVector net_wm_atoms; QVector net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt5xcbqpa-dev/5.9.4/qxcbxsettings.h000066400000000000000000000020171476226662200252430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/000077500000000000000000000000001476226662200215105ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/000077500000000000000000000000001476226662200253475ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/qxcbglintegration.h000066400000000000000000000057301476226662200312510ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_XCB_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaGl) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000042601476226662200326360ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000052571476226662200324740ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000062211476226662200331040ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267525ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000070431476226662200321610ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000042671476226662200321250ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000063311476226662200330170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } void *xlib_display() const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000057061476226662200351270ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000051631476226662200320050ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; #if QT_CONFIG(xcb_xlib) const xcb_visualtype_t *createVisual() override; #endif private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267755ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000077151476226662200323770ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000060361476226662200330670ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000050771476226662200351760ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_glx/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000043251476226662200320520ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/000077500000000000000000000000001476226662200251775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qbackingstore_x11_p.h000066400000000000000000000052671476226662200312260ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qcolormap_x11_p.h000066400000000000000000000051501476226662200303560ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qpaintengine_x11_p.h000066400000000000000000000112241476226662200310420ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qpixmap_x11_p.h000066400000000000000000000131131476226662200300360ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qpolygonclipper_p.h000066400000000000000000000233621476226662200311240ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qt_x11_p.h000066400000000000000000000123301476226662200270030ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qtessellator_p.h000066400000000000000000000056501476226662200304170ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/nativepainting/qxcbnativepainting.h000066400000000000000000000066141476226662200312550ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbatom.h000066400000000000000000000147621476226662200241600ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, _ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbbackingstore.h000066400000000000000000000101011476226662200256520ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; #ifndef QT_NO_OPENGL void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; #endif QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbclipboard.h000066400000000000000000000124711476226662200251520ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbconnection.h000066400000000000000000000364431476226662200253570ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const { return m_startupId; } void setStartupId(const QByteArray &nextId) { m_startupId = nextId; } void clearStartupId() { m_startupId.clear(); } void grabServer(); void ungrabServer(); bool isUnity() const { return m_xdgCurrentDesktop == "unity"; } bool isGnome() const { return m_xdgCurrentDesktop == "gnome"; } QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QByteArray m_xdgCurrentDesktop; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbconnection_basic.h000066400000000000000000000137411476226662200265140ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbcursor.h000066400000000000000000000107131476226662200245250ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbdrag.h000066400000000000000000000154411476226662200241300ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbeventdispatcher.h000066400000000000000000000067371476226662200264130ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbeventqueue.h000066400000000000000000000145461476226662200254060ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = std::numeric_limits::max()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbexport.h000066400000000000000000000042021476226662200245250ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbimage.h000066400000000000000000000053151476226662200242740ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbintegration.h000066400000000000000000000131421476226662200255320ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #ifndef QT_NO_ACCESSIBILITY QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #ifndef QT_NO_ACCESSIBILITY mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbkeyboard.h000066400000000000000000000107371476226662200250160ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(xcb_xkb_new_keyboard_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbmime.h000066400000000000000000000057261476226662200241470ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbnativeinterface.h000066400000000000000000000154521476226662200263640ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbobject.h000066400000000000000000000047161476226662200244640ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbscreen.h000066400000000000000000000226711476226662200244750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbscrollingdevice_p.h000066400000000000000000000067521476226662200267130ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbsessionmanager.h000066400000000000000000000062211476226662200262250ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2013 Teo Mrnjavac ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbsystemtraytracker.h000066400000000000000000000061401476226662200270070ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); static xcb_window_t locateTrayWindow(const QXcbConnection *connection, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbvulkaninstance.h000066400000000000000000000054571476226662200262460ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbvulkanwindow.h000066400000000000000000000044661476226662200257500ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbwindow.h000066400000000000000000000264211476226662200245220ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum Task { Map, Unmap, SetGeometry, SetWindowFlags, SetWindowState }; QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; bool shouldDeferTask(Task task); void handleDeferredTasks(); void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1String("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; bool m_wmStateValid = true; QVector m_deferredTasks; bool m_isWmManagedWindow = true; QRect m_deferredGeometry; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbwmsupport.h000066400000000000000000000046701476226662200252750ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.2.4/qxcbxsettings.h000066400000000000000000000054221476226662200252410ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/000077500000000000000000000000001476226662200253475ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/qxcbglintegration.h000066400000000000000000000023221476226662200312430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_XCB_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaGl) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000006521476226662200326370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000016511476226662200324660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026131476226662200331050ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267525ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000034351476226662200321620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000006611476226662200321170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000030541476226662200330160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } void *xlib_display() const; xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000023001476226662200351120ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000015151476226662200320020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; const xcb_visualtype_t *createVisual() override; private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267755ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000043071476226662200323710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000024301476226662200330610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000014711476226662200351700ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_glx// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000007171476226662200320530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/000077500000000000000000000000001476226662200251775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qbackingstore_x11_p.h000066400000000000000000000016611476226662200312200ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qcolormap_x11_p.h000066400000000000000000000015421476226662200303570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056161476226662200310520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qpixmap_x11_p.h000066400000000000000000000075051476226662200300460ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qpolygonclipper_p.h000066400000000000000000000177471476226662200311360ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qt_x11_p.h000066400000000000000000000067221476226662200270130ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qtessellator_p.h000066400000000000000000000022421476226662200304110ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/nativepainting/qxcbnativepainting.h000066400000000000000000000032061476226662200312470ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qt_xlib_wrapper.h000066400000000000000000000005231476226662200255320ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbatom.h000066400000000000000000000113771476226662200241570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, MANAGER, // System tray notification _NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state WM_STATE, WM_CHANGE_STATE, WM_CLASS, WM_NAME, // Session management WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID, WM_CLIENT_MACHINE, // Clipboard CLIPBOARD, INCR, TARGETS, MULTIPLE, TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER, _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, // Qt/XCB specific _QT_CLOSE_CONNECTION, _MOTIF_WM_HINTS, DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER, // EWMH (aka NETWM) _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW, _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON, _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE, _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_STATE_HIDDEN, _NET_WM_USER_TIME, _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP, _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY, _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU, _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND, _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_FRAME_EXTENTS, _NET_STARTUP_INFO, _NET_STARTUP_INFO_BEGIN, _NET_STARTUP_ID, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL, _NET_ACTIVE_WINDOW, // Property formats TEXT, UTF8_STRING, CARDINAL, // Xdnd XdndEnter, XdndPosition, XdndStatus, XdndLeave, XdndDrop, XdndFinished, XdndTypelist, XdndActionList, XdndSelection, XdndAware, XdndProxy, XdndActionCopy, XdndActionLink, XdndActionMove, XdndActionAsk, XdndActionPrivate, // Xkb _XKB_RULES_NAMES, // XEMBED _XEMBED, _XEMBED_INFO, // XInput2 ButtonLeft, ButtonMiddle, ButtonRight, ButtonWheelUp, ButtonWheelDown, ButtonHorizWheelLeft, ButtonHorizWheelRight, AbsMTPositionX, AbsMTPositionY, AbsMTTouchMajor, AbsMTTouchMinor, AbsMTOrientation, AbsMTPressure, AbsMTTrackingID, MaxContacts, RelX, RelY, // XInput2 tablet AbsX, AbsY, AbsPressure, AbsTiltX, AbsTiltY, AbsWheel, AbsDistance, WacomSerialIDs, INTEGER, RelHorizWheel, RelVertWheel, RelHorizScroll, RelVertScroll, _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, _COMPIZ_DECOR_REQUEST, _COMPIZ_DECOR_DELETE_PIXMAP, _COMPIZ_TOOLKIT_ACTION, _GTK_LOAD_ICONTHEMES, AT_SPI_BUS, EDID, EDID_DATA, XFree86_DDC_EDID1_RAWDATA, _ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbbackingstore.h000066400000000000000000000046101476226662200256620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbclipboard.h000066400000000000000000000067151476226662200251560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbconnection.h000066400000000000000000000350021476226662200253450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbconnection_basic.h000066400000000000000000000107431476226662200265130ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbcursor.h000066400000000000000000000053051476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); #endif bool m_gtkCursorThemeInitialized; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbdrag.h000066400000000000000000000120261476226662200241240ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions enum { XdndDropTransactionTimeout = 600000 }; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbeventdispatcher.h000066400000000000000000000033231476226662200263770ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbeventqueue.h000066400000000000000000000111341476226662200253740ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbexport.h000066400000000000000000000005741476226662200245350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbimage.h000066400000000000000000000017071476226662200242750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbintegration.h000066400000000000000000000075361476226662200255440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbkeyboard.h000066400000000000000000000052261476226662200250130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbmime.h000066400000000000000000000023201476226662200241320ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbnativeinterface.h000066400000000000000000000117541476226662200263650ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbobject.h000066400000000000000000000013101476226662200244470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbscreen.h000066400000000000000000000210041476226662200244620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbscrollingdevice_p.h000066400000000000000000000033441476226662200267050ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbsessionmanager.h000066400000000000000000000026131476226662200262260ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbsystemtraytracker.h000066400000000000000000000023711476226662200270110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbvulkaninstance.h000066400000000000000000000020551476226662200262350ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbvulkanwindow.h000066400000000000000000000010601476226662200257330ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbwindow.h000066400000000000000000000232511476226662200245200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle) : QXcbWindow(window) { m_window = nativeHandle; } ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbwmsupport.h000066400000000000000000000012621476226662200252670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.4.2/qxcbxsettings.h000066400000000000000000000020141476226662200252330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/000077500000000000000000000000001476226662200221575ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/000077500000000000000000000000001476226662200253475ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/qxcbglintegration.h000066400000000000000000000023701476226662200312460ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000007061476226662200326370ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000017051476226662200324660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026471476226662200331140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267525ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000034711476226662200321620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000006451476226662200321210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000030501476226662200330120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000023341476226662200351210ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000015511476226662200320020ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; const xcb_visualtype_t *createVisual() override; private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267755ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000043431476226662200323710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000024641476226662200330700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000015251476226662200351700ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_glx// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000007531476226662200320530ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/000077500000000000000000000000001476226662200251775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qbackingstore_x11_p.h000066400000000000000000000017151476226662200312200ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qcolormap_x11_p.h000066400000000000000000000015761476226662200303660ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056521476226662200310520ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qpixmap_x11_p.h000066400000000000000000000075411476226662200300460ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qpolygonclipper_p.h000066400000000000000000000200031476226662200311110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qt_x11_p.h000066400000000000000000000067561476226662200270220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qtessellator_p.h000066400000000000000000000022761476226662200304200ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/nativepainting/qxcbnativepainting.h000066400000000000000000000032421476226662200312470ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qt_xlib_wrapper.h000066400000000000000000000005571476226662200255410ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbatom.h000066400000000000000000000126171476226662200241550ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols AtomWM_PROTOCOLS, AtomWM_DELETE_WINDOW, AtomWM_TAKE_FOCUS, Atom_NET_WM_PING, Atom_NET_WM_CONTEXT_HELP, Atom_NET_WM_SYNC_REQUEST, Atom_NET_WM_SYNC_REQUEST_COUNTER, AtomMANAGER, // System tray notification Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state AtomWM_STATE, AtomWM_CHANGE_STATE, AtomWM_CLASS, AtomWM_NAME, // Session management AtomWM_CLIENT_LEADER, AtomWM_WINDOW_ROLE, AtomSM_CLIENT_ID, AtomWM_CLIENT_MACHINE, // Clipboard AtomCLIPBOARD, AtomINCR, AtomTARGETS, AtomMULTIPLE, AtomTIMESTAMP, AtomSAVE_TARGETS, AtomCLIP_TEMPORARY, Atom_QT_SELECTION, Atom_QT_CLIPBOARD_SENTINEL, Atom_QT_SELECTION_SENTINEL, AtomCLIPBOARD_MANAGER, AtomRESOURCE_MANAGER, Atom_XSETROOT_ID, Atom_QT_SCROLL_DONE, Atom_QT_INPUT_ENCODING, // Qt/XCB specific Atom_QT_CLOSE_CONNECTION, Atom_QT_GET_TIMESTAMP, Atom_MOTIF_WM_HINTS, AtomDTWM_IS_RUNNING, AtomENLIGHTENMENT_DESKTOP, Atom_DT_SAVE_MODE, Atom_SGI_DESKS_MANAGER, // EWMH (aka NETWM) Atom_NET_SUPPORTED, Atom_NET_VIRTUAL_ROOTS, Atom_NET_WORKAREA, Atom_NET_MOVERESIZE_WINDOW, Atom_NET_WM_MOVERESIZE, Atom_NET_WM_NAME, Atom_NET_WM_ICON_NAME, Atom_NET_WM_ICON, Atom_NET_WM_PID, Atom_NET_WM_WINDOW_OPACITY, Atom_NET_WM_STATE, Atom_NET_WM_STATE_ABOVE, Atom_NET_WM_STATE_BELOW, Atom_NET_WM_STATE_FULLSCREEN, Atom_NET_WM_STATE_MAXIMIZED_HORZ, Atom_NET_WM_STATE_MAXIMIZED_VERT, Atom_NET_WM_STATE_MODAL, Atom_NET_WM_STATE_STAYS_ON_TOP, Atom_NET_WM_STATE_DEMANDS_ATTENTION, Atom_NET_WM_STATE_HIDDEN, Atom_NET_WM_USER_TIME, Atom_NET_WM_USER_TIME_WINDOW, Atom_NET_WM_FULL_PLACEMENT, Atom_NET_WM_WINDOW_TYPE, Atom_NET_WM_WINDOW_TYPE_DESKTOP, Atom_NET_WM_WINDOW_TYPE_DOCK, Atom_NET_WM_WINDOW_TYPE_TOOLBAR, Atom_NET_WM_WINDOW_TYPE_MENU, Atom_NET_WM_WINDOW_TYPE_UTILITY, Atom_NET_WM_WINDOW_TYPE_SPLASH, Atom_NET_WM_WINDOW_TYPE_DIALOG, Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, Atom_NET_WM_WINDOW_TYPE_TOOLTIP, Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, Atom_NET_WM_WINDOW_TYPE_COMBO, Atom_NET_WM_WINDOW_TYPE_DND, Atom_NET_WM_WINDOW_TYPE_NORMAL, Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, Atom_KDE_NET_WM_FRAME_STRUT, Atom_NET_FRAME_EXTENTS, Atom_NET_STARTUP_INFO, Atom_NET_STARTUP_INFO_BEGIN, Atom_NET_STARTUP_ID, Atom_NET_SUPPORTING_WM_CHECK, Atom_NET_WM_CM_S0, Atom_NET_SYSTEM_TRAY_VISUAL, Atom_NET_ACTIVE_WINDOW, // Property formats AtomTEXT, AtomUTF8_STRING, AtomCARDINAL, // Xdnd AtomXdndEnter, AtomXdndPosition, AtomXdndStatus, AtomXdndLeave, AtomXdndDrop, AtomXdndFinished, AtomXdndTypelist, AtomXdndActionList, AtomXdndSelection, AtomXdndAware, AtomXdndProxy, AtomXdndActionCopy, AtomXdndActionLink, AtomXdndActionMove, AtomXdndActionAsk, AtomXdndActionPrivate, // Xkb Atom_XKB_RULES_NAMES, // XEMBED Atom_XEMBED, Atom_XEMBED_INFO, // XInput2 AtomButtonLeft, AtomButtonMiddle, AtomButtonRight, AtomButtonWheelUp, AtomButtonWheelDown, AtomButtonHorizWheelLeft, AtomButtonHorizWheelRight, AtomAbsMTPositionX, AtomAbsMTPositionY, AtomAbsMTTouchMajor, AtomAbsMTTouchMinor, AtomAbsMTOrientation, AtomAbsMTPressure, AtomAbsMTTrackingID, AtomMaxContacts, AtomRelX, AtomRelY, // XInput2 tablet AtomAbsX, AtomAbsY, AtomAbsPressure, AtomAbsTiltX, AtomAbsTiltY, AtomAbsWheel, AtomAbsDistance, AtomWacomSerialIDs, AtomINTEGER, AtomRelHorizWheel, AtomRelVertWheel, AtomRelHorizScroll, AtomRelVertScroll, Atom_XSETTINGS_SETTINGS, Atom_COMPIZ_DECOR_PENDING, Atom_COMPIZ_DECOR_REQUEST, Atom_COMPIZ_DECOR_DELETE_PIXMAP, Atom_COMPIZ_TOOLKIT_ACTION, Atom_GTK_LOAD_ICONTHEMES, AtomAT_SPI_BUS, AtomEDID, AtomEDID_DATA, AtomXFree86_DDC_EDID1_RAWDATA, Atom_ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbbackingstore.h000066400000000000000000000046441476226662200256710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbclipboard.h000066400000000000000000000067511476226662200251560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbconnection.h000066400000000000000000000350571476226662200253570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbconnection_basic.h000066400000000000000000000107771476226662200265220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbcursor.h000066400000000000000000000054221476226662200245260ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; void updateContext(); static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; xcb_cursor_context_t *m_cursorContext; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); bool m_callbackForPropertyRegistered; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbcursorfont.h000066400000000000000000000041441476226662200254150ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // copied from #ifndef QXCBCURSORFONT_H #define QXCBCURSORFONT_H #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* QXCBCURSORFONT_H */ qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbdrag.h000066400000000000000000000120561476226662200241270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbeventdispatcher.h000066400000000000000000000033571476226662200264060ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbeventqueue.h000066400000000000000000000111701476226662200253740ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbexport.h000066400000000000000000000006301476226662200245260ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbimage.h000066400000000000000000000017431476226662200242750ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbintegration.h000066400000000000000000000076611476226662200255430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } void setApplicationBadge(qint64 number) override; private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbkeyboard.h000066400000000000000000000052621476226662200250130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbmime.h000066400000000000000000000023541476226662200241410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbnativeinterface.h000066400000000000000000000120101476226662200263470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbobject.h000066400000000000000000000013441476226662200244560ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbscreen.h000066400000000000000000000210401476226662200244620ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbscrollingdevice_p.h000066400000000000000000000034001476226662200266760ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbsessionmanager.h000066400000000000000000000026471476226662200262350ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbsystemtraytracker.h000066400000000000000000000024251476226662200270110ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbvulkaninstance.h000066400000000000000000000021111476226662200262260ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbvulkanwindow.h000066400000000000000000000011141476226662200257330ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbwindow.h000066400000000000000000000232141476226662200245170ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle); ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbwmsupport.h000066400000000000000000000013161476226662200252670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.0/qxcbxsettings.h000066400000000000000000000020501476226662200252330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/000077500000000000000000000000001476226662200221605ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/000077500000000000000000000000001476226662200253505ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/qxcbglintegration.h000066400000000000000000000023701476226662200312470ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000007061476226662200326400ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000017051476226662200324670ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026471476226662200331150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267535ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000034711476226662200321630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000006451476226662200321220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000030501476226662200330130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000023341476226662200351220ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000015511476226662200320030ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; const xcb_visualtype_t *createVisual() override; private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267765ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000043431476226662200323720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000024641476226662200330710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000015251476226662200351710ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_glx// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000007531476226662200320540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/000077500000000000000000000000001476226662200252005ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qbackingstore_x11_p.h000066400000000000000000000017151476226662200312210ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qcolormap_x11_p.h000066400000000000000000000015761476226662200303670ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056521476226662200310530ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qpixmap_x11_p.h000066400000000000000000000075411476226662200300470ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qpolygonclipper_p.h000066400000000000000000000200031476226662200311120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qt_x11_p.h000066400000000000000000000067561476226662200270230ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qtessellator_p.h000066400000000000000000000022761476226662200304210ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/nativepainting/qxcbnativepainting.h000066400000000000000000000032421476226662200312500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qt_xlib_wrapper.h000066400000000000000000000005571476226662200255420ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbatom.h000066400000000000000000000127261476226662200241570ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols AtomWM_PROTOCOLS, AtomWM_DELETE_WINDOW, AtomWM_TAKE_FOCUS, Atom_NET_WM_PING, Atom_NET_WM_CONTEXT_HELP, Atom_NET_WM_SYNC_REQUEST, Atom_NET_WM_SYNC_REQUEST_COUNTER, AtomMANAGER, // System tray notification Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state AtomWM_STATE, AtomWM_CHANGE_STATE, AtomWM_CLASS, AtomWM_NAME, // Session management AtomWM_CLIENT_LEADER, AtomWM_WINDOW_ROLE, AtomSM_CLIENT_ID, AtomWM_CLIENT_MACHINE, // Clipboard AtomCLIPBOARD, AtomINCR, AtomTARGETS, AtomMULTIPLE, AtomTIMESTAMP, AtomSAVE_TARGETS, AtomCLIP_TEMPORARY, Atom_QT_SELECTION, Atom_QT_CLIPBOARD_SENTINEL, Atom_QT_SELECTION_SENTINEL, AtomCLIPBOARD_MANAGER, AtomRESOURCE_MANAGER, Atom_XSETROOT_ID, Atom_QT_SCROLL_DONE, Atom_QT_INPUT_ENCODING, // Qt/XCB specific Atom_QT_CLOSE_CONNECTION, Atom_QT_GET_TIMESTAMP, Atom_MOTIF_WM_HINTS, AtomDTWM_IS_RUNNING, AtomENLIGHTENMENT_DESKTOP, Atom_DT_SAVE_MODE, Atom_SGI_DESKS_MANAGER, // EWMH (aka NETWM) Atom_NET_SUPPORTED, Atom_NET_VIRTUAL_ROOTS, Atom_NET_WORKAREA, Atom_NET_MOVERESIZE_WINDOW, Atom_NET_WM_MOVERESIZE, Atom_NET_WM_NAME, Atom_NET_WM_ICON_NAME, Atom_NET_WM_ICON, Atom_NET_WM_PID, Atom_NET_WM_WINDOW_OPACITY, Atom_NET_WM_STATE, Atom_NET_WM_STATE_ABOVE, Atom_NET_WM_STATE_BELOW, Atom_NET_WM_STATE_FULLSCREEN, Atom_NET_WM_STATE_MAXIMIZED_HORZ, Atom_NET_WM_STATE_MAXIMIZED_VERT, Atom_NET_WM_STATE_MODAL, Atom_NET_WM_STATE_STAYS_ON_TOP, Atom_NET_WM_STATE_DEMANDS_ATTENTION, Atom_NET_WM_STATE_HIDDEN, Atom_NET_WM_USER_TIME, Atom_NET_WM_USER_TIME_WINDOW, Atom_NET_WM_FULL_PLACEMENT, Atom_NET_WM_WINDOW_TYPE, Atom_NET_WM_WINDOW_TYPE_DESKTOP, Atom_NET_WM_WINDOW_TYPE_DOCK, Atom_NET_WM_WINDOW_TYPE_TOOLBAR, Atom_NET_WM_WINDOW_TYPE_MENU, Atom_NET_WM_WINDOW_TYPE_UTILITY, Atom_NET_WM_WINDOW_TYPE_SPLASH, Atom_NET_WM_WINDOW_TYPE_DIALOG, Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, Atom_NET_WM_WINDOW_TYPE_TOOLTIP, Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, Atom_NET_WM_WINDOW_TYPE_COMBO, Atom_NET_WM_WINDOW_TYPE_DND, Atom_NET_WM_WINDOW_TYPE_NORMAL, Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, Atom_KDE_NET_WM_DESKTOP_FILE, Atom_KDE_NET_WM_FRAME_STRUT, Atom_NET_FRAME_EXTENTS, Atom_NET_STARTUP_INFO, Atom_NET_STARTUP_INFO_BEGIN, Atom_NET_STARTUP_ID, Atom_NET_SUPPORTING_WM_CHECK, Atom_NET_WM_CM_S0, Atom_NET_SYSTEM_TRAY_VISUAL, Atom_NET_ACTIVE_WINDOW, // Property formats AtomTEXT, AtomUTF8_STRING, AtomCARDINAL, // Xdnd AtomXdndEnter, AtomXdndPosition, AtomXdndStatus, AtomXdndLeave, AtomXdndDrop, AtomXdndFinished, AtomXdndTypelist, AtomXdndActionList, AtomXdndSelection, AtomXdndAware, AtomXdndProxy, AtomXdndActionCopy, AtomXdndActionLink, AtomXdndActionMove, AtomXdndActionAsk, AtomXdndActionPrivate, // Xkb Atom_XKB_RULES_NAMES, // XEMBED Atom_XEMBED, Atom_XEMBED_INFO, // XInput2 AtomButtonLeft, AtomButtonMiddle, AtomButtonRight, AtomButtonWheelUp, AtomButtonWheelDown, AtomButtonHorizWheelLeft, AtomButtonHorizWheelRight, AtomAbsMTPositionX, AtomAbsMTPositionY, AtomAbsMTTouchMajor, AtomAbsMTTouchMinor, AtomAbsMTOrientation, AtomAbsMTPressure, AtomAbsMTTrackingID, AtomMaxContacts, AtomRelX, AtomRelY, // XInput2 tablet AtomAbsX, AtomAbsY, AtomAbsPressure, AtomAbsTiltX, AtomAbsTiltY, AtomAbsWheel, AtomAbsDistance, AtomWacomSerialIDs, AtomINTEGER, AtomRelHorizWheel, AtomRelVertWheel, AtomRelHorizScroll, AtomRelVertScroll, Atom_XSETTINGS_SETTINGS, Atom_COMPIZ_DECOR_PENDING, Atom_COMPIZ_DECOR_REQUEST, Atom_COMPIZ_DECOR_DELETE_PIXMAP, Atom_COMPIZ_TOOLKIT_ACTION, Atom_GTK_APPLICATION_ID, Atom_GTK_LOAD_ICONTHEMES, AtomAT_SPI_BUS, AtomEDID, AtomEDID_DATA, AtomXFree86_DDC_EDID1_RAWDATA, Atom_ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbbackingstore.h000066400000000000000000000046441476226662200256720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbclipboard.h000066400000000000000000000067511476226662200251570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbconnection.h000066400000000000000000000350571476226662200253600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbconnection_basic.h000066400000000000000000000107771476226662200265230ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbcursor.h000066400000000000000000000054641476226662200245350ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; QSize size() const override; void updateContext(); static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; xcb_cursor_context_t *m_cursorContext; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); bool m_callbackForPropertyRegistered; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbcursorfont.h000066400000000000000000000041441476226662200254160ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // copied from #ifndef QXCBCURSORFONT_H #define QXCBCURSORFONT_H #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* QXCBCURSORFONT_H */ qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbdrag.h000066400000000000000000000120561476226662200241300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbeventdispatcher.h000066400000000000000000000033571476226662200264070ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbeventqueue.h000066400000000000000000000111701476226662200253750ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbexport.h000066400000000000000000000006301476226662200245270ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbimage.h000066400000000000000000000017431476226662200242760ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbintegration.h000066400000000000000000000076611476226662200255440ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } void setApplicationBadge(qint64 number) override; private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbkeyboard.h000066400000000000000000000052621476226662200250140ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbmime.h000066400000000000000000000023541476226662200241420ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbnativeinterface.h000066400000000000000000000120101476226662200263500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbobject.h000066400000000000000000000013441476226662200244570ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbscreen.h000066400000000000000000000210401476226662200244630ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbscrollingdevice_p.h000066400000000000000000000034001476226662200266770ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbsessionmanager.h000066400000000000000000000026471476226662200262360ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbsystemtraytracker.h000066400000000000000000000024251476226662200270120ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbvulkaninstance.h000066400000000000000000000021111476226662200262270ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbvulkanwindow.h000066400000000000000000000011141476226662200257340ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbwindow.h000066400000000000000000000232141476226662200245200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle); ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbwmsupport.h000066400000000000000000000013161476226662200252700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.1/qxcbxsettings.h000066400000000000000000000020501476226662200252340ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/000077500000000000000000000000001476226662200221615ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/000077500000000000000000000000001476226662200253515ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegration.h000066400000000000000000000023701476226662200312500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000007061476226662200326410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000017051476226662200324700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026471476226662200331160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/000077500000000000000000000000001476226662200252015ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qbackingstore_x11_p.h000066400000000000000000000017151476226662200312220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qcolormap_x11_p.h000066400000000000000000000015761476226662200303700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056521476226662200310540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpixmap_x11_p.h000066400000000000000000000075411476226662200300500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qpolygonclipper_p.h000066400000000000000000000200031476226662200311130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qt_x11_p.h000066400000000000000000000067561476226662200270240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qtessellator_p.h000066400000000000000000000022761476226662200304220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/nativepainting/qxcbnativepainting.h000066400000000000000000000032421476226662200312510ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qt_xlib_wrapper.h000066400000000000000000000005571476226662200255430ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbatom.h000066400000000000000000000127261476226662200241600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols AtomWM_PROTOCOLS, AtomWM_DELETE_WINDOW, AtomWM_TAKE_FOCUS, Atom_NET_WM_PING, Atom_NET_WM_CONTEXT_HELP, Atom_NET_WM_SYNC_REQUEST, Atom_NET_WM_SYNC_REQUEST_COUNTER, AtomMANAGER, // System tray notification Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state AtomWM_STATE, AtomWM_CHANGE_STATE, AtomWM_CLASS, AtomWM_NAME, // Session management AtomWM_CLIENT_LEADER, AtomWM_WINDOW_ROLE, AtomSM_CLIENT_ID, AtomWM_CLIENT_MACHINE, // Clipboard AtomCLIPBOARD, AtomINCR, AtomTARGETS, AtomMULTIPLE, AtomTIMESTAMP, AtomSAVE_TARGETS, AtomCLIP_TEMPORARY, Atom_QT_SELECTION, Atom_QT_CLIPBOARD_SENTINEL, Atom_QT_SELECTION_SENTINEL, AtomCLIPBOARD_MANAGER, AtomRESOURCE_MANAGER, Atom_XSETROOT_ID, Atom_QT_SCROLL_DONE, Atom_QT_INPUT_ENCODING, // Qt/XCB specific Atom_QT_CLOSE_CONNECTION, Atom_QT_GET_TIMESTAMP, Atom_MOTIF_WM_HINTS, AtomDTWM_IS_RUNNING, AtomENLIGHTENMENT_DESKTOP, Atom_DT_SAVE_MODE, Atom_SGI_DESKS_MANAGER, // EWMH (aka NETWM) Atom_NET_SUPPORTED, Atom_NET_VIRTUAL_ROOTS, Atom_NET_WORKAREA, Atom_NET_MOVERESIZE_WINDOW, Atom_NET_WM_MOVERESIZE, Atom_NET_WM_NAME, Atom_NET_WM_ICON_NAME, Atom_NET_WM_ICON, Atom_NET_WM_PID, Atom_NET_WM_WINDOW_OPACITY, Atom_NET_WM_STATE, Atom_NET_WM_STATE_ABOVE, Atom_NET_WM_STATE_BELOW, Atom_NET_WM_STATE_FULLSCREEN, Atom_NET_WM_STATE_MAXIMIZED_HORZ, Atom_NET_WM_STATE_MAXIMIZED_VERT, Atom_NET_WM_STATE_MODAL, Atom_NET_WM_STATE_STAYS_ON_TOP, Atom_NET_WM_STATE_DEMANDS_ATTENTION, Atom_NET_WM_STATE_HIDDEN, Atom_NET_WM_USER_TIME, Atom_NET_WM_USER_TIME_WINDOW, Atom_NET_WM_FULL_PLACEMENT, Atom_NET_WM_WINDOW_TYPE, Atom_NET_WM_WINDOW_TYPE_DESKTOP, Atom_NET_WM_WINDOW_TYPE_DOCK, Atom_NET_WM_WINDOW_TYPE_TOOLBAR, Atom_NET_WM_WINDOW_TYPE_MENU, Atom_NET_WM_WINDOW_TYPE_UTILITY, Atom_NET_WM_WINDOW_TYPE_SPLASH, Atom_NET_WM_WINDOW_TYPE_DIALOG, Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, Atom_NET_WM_WINDOW_TYPE_TOOLTIP, Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, Atom_NET_WM_WINDOW_TYPE_COMBO, Atom_NET_WM_WINDOW_TYPE_DND, Atom_NET_WM_WINDOW_TYPE_NORMAL, Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, Atom_KDE_NET_WM_DESKTOP_FILE, Atom_KDE_NET_WM_FRAME_STRUT, Atom_NET_FRAME_EXTENTS, Atom_NET_STARTUP_INFO, Atom_NET_STARTUP_INFO_BEGIN, Atom_NET_STARTUP_ID, Atom_NET_SUPPORTING_WM_CHECK, Atom_NET_WM_CM_S0, Atom_NET_SYSTEM_TRAY_VISUAL, Atom_NET_ACTIVE_WINDOW, // Property formats AtomTEXT, AtomUTF8_STRING, AtomCARDINAL, // Xdnd AtomXdndEnter, AtomXdndPosition, AtomXdndStatus, AtomXdndLeave, AtomXdndDrop, AtomXdndFinished, AtomXdndTypelist, AtomXdndActionList, AtomXdndSelection, AtomXdndAware, AtomXdndProxy, AtomXdndActionCopy, AtomXdndActionLink, AtomXdndActionMove, AtomXdndActionAsk, AtomXdndActionPrivate, // Xkb Atom_XKB_RULES_NAMES, // XEMBED Atom_XEMBED, Atom_XEMBED_INFO, // XInput2 AtomButtonLeft, AtomButtonMiddle, AtomButtonRight, AtomButtonWheelUp, AtomButtonWheelDown, AtomButtonHorizWheelLeft, AtomButtonHorizWheelRight, AtomAbsMTPositionX, AtomAbsMTPositionY, AtomAbsMTTouchMajor, AtomAbsMTTouchMinor, AtomAbsMTOrientation, AtomAbsMTPressure, AtomAbsMTTrackingID, AtomMaxContacts, AtomRelX, AtomRelY, // XInput2 tablet AtomAbsX, AtomAbsY, AtomAbsPressure, AtomAbsTiltX, AtomAbsTiltY, AtomAbsWheel, AtomAbsDistance, AtomWacomSerialIDs, AtomINTEGER, AtomRelHorizWheel, AtomRelVertWheel, AtomRelHorizScroll, AtomRelVertScroll, Atom_XSETTINGS_SETTINGS, Atom_COMPIZ_DECOR_PENDING, Atom_COMPIZ_DECOR_REQUEST, Atom_COMPIZ_DECOR_DELETE_PIXMAP, Atom_COMPIZ_TOOLKIT_ACTION, Atom_GTK_APPLICATION_ID, Atom_GTK_LOAD_ICONTHEMES, AtomAT_SPI_BUS, AtomEDID, AtomEDID_DATA, AtomXFree86_DDC_EDID1_RAWDATA, Atom_ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbbackingstore.h000066400000000000000000000046441476226662200256730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbclipboard.h000066400000000000000000000067511476226662200251600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection.h000066400000000000000000000350571476226662200253610ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; Qt::KeyboardModifiers queryKeyboardModifiers() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbconnection_basic.h000066400000000000000000000107771476226662200265240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursor.h000066400000000000000000000054641476226662200245360ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; QSize size() const override; void updateContext(); static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; xcb_cursor_context_t *m_cursorContext; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); bool m_callbackForPropertyRegistered; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbcursorfont.h000066400000000000000000000041441476226662200254170ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // copied from #ifndef QXCBCURSORFONT_H #define QXCBCURSORFONT_H #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* QXCBCURSORFONT_H */ qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbdrag.h000066400000000000000000000120561476226662200241310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventdispatcher.h000066400000000000000000000033571476226662200264100ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbeventqueue.h000066400000000000000000000111701476226662200253760ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbexport.h000066400000000000000000000006301476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbimage.h000066400000000000000000000017431476226662200242770ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbintegration.h000066400000000000000000000076611476226662200255450ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; QList possibleKeys(const QKeyEvent *e) const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } void setApplicationBadge(qint64 number) override; private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbkeyboard.h000066400000000000000000000052621476226662200250150ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbmime.h000066400000000000000000000023541476226662200241430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbnativeinterface.h000066400000000000000000000120101476226662200263510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbobject.h000066400000000000000000000013441476226662200244600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscreen.h000066400000000000000000000210401476226662200244640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbscrollingdevice_p.h000066400000000000000000000034001476226662200267000ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsessionmanager.h000066400000000000000000000026471476226662200262370ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbsystemtraytracker.h000066400000000000000000000024251476226662200270130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkaninstance.h000066400000000000000000000021111476226662200262300ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbvulkanwindow.h000066400000000000000000000011141476226662200257350ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwindow.h000066400000000000000000000236101476226662200245210ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QObject, public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { Q_OBJECT public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); void updateWmTransientFor(); void registerWmTransientForChild(QXcbWindow *); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; QMutex m_mappedMutex; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; QList> m_wmTransientForChildren; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle); ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbwmsupport.h000066400000000000000000000013161476226662200252710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.6.2/qxcbxsettings.h000066400000000000000000000020501476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/000077500000000000000000000000001476226662200221615ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/000077500000000000000000000000001476226662200253515ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/qxcbglintegration.h000066400000000000000000000023701476226662200312500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000007061476226662200326410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000017051476226662200324700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026471476226662200331160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267545ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000034711476226662200321640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000006451476226662200321230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000032271476226662200330220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } bool usingPlatformDisplay() const { return m_using_platform_display; } xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; bool m_using_platform_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000023341476226662200351230ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000015511476226662200320040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; const xcb_visualtype_t *createVisual() override; private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000043431476226662200323730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000024641476226662200330720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000015251476226662200351720ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_glx// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000007531476226662200320550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/000077500000000000000000000000001476226662200252015ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qbackingstore_x11_p.h000066400000000000000000000017151476226662200312220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qcolormap_x11_p.h000066400000000000000000000015761476226662200303700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056521476226662200310540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qpixmap_x11_p.h000066400000000000000000000075411476226662200300500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qpolygonclipper_p.h000066400000000000000000000200031476226662200311130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qt_x11_p.h000066400000000000000000000067561476226662200270240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qtessellator_p.h000066400000000000000000000022761476226662200304220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/nativepainting/qxcbnativepainting.h000066400000000000000000000032421476226662200312510ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qt_xlib_wrapper.h000066400000000000000000000005571476226662200255430ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbatom.h000066400000000000000000000127261476226662200241600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols AtomWM_PROTOCOLS, AtomWM_DELETE_WINDOW, AtomWM_TAKE_FOCUS, Atom_NET_WM_PING, Atom_NET_WM_CONTEXT_HELP, Atom_NET_WM_SYNC_REQUEST, Atom_NET_WM_SYNC_REQUEST_COUNTER, AtomMANAGER, // System tray notification Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state AtomWM_STATE, AtomWM_CHANGE_STATE, AtomWM_CLASS, AtomWM_NAME, // Session management AtomWM_CLIENT_LEADER, AtomWM_WINDOW_ROLE, AtomSM_CLIENT_ID, AtomWM_CLIENT_MACHINE, // Clipboard AtomCLIPBOARD, AtomINCR, AtomTARGETS, AtomMULTIPLE, AtomTIMESTAMP, AtomSAVE_TARGETS, AtomCLIP_TEMPORARY, Atom_QT_SELECTION, Atom_QT_CLIPBOARD_SENTINEL, Atom_QT_SELECTION_SENTINEL, AtomCLIPBOARD_MANAGER, AtomRESOURCE_MANAGER, Atom_XSETROOT_ID, Atom_QT_SCROLL_DONE, Atom_QT_INPUT_ENCODING, // Qt/XCB specific Atom_QT_CLOSE_CONNECTION, Atom_QT_GET_TIMESTAMP, Atom_MOTIF_WM_HINTS, AtomDTWM_IS_RUNNING, AtomENLIGHTENMENT_DESKTOP, Atom_DT_SAVE_MODE, Atom_SGI_DESKS_MANAGER, // EWMH (aka NETWM) Atom_NET_SUPPORTED, Atom_NET_VIRTUAL_ROOTS, Atom_NET_WORKAREA, Atom_NET_MOVERESIZE_WINDOW, Atom_NET_WM_MOVERESIZE, Atom_NET_WM_NAME, Atom_NET_WM_ICON_NAME, Atom_NET_WM_ICON, Atom_NET_WM_PID, Atom_NET_WM_WINDOW_OPACITY, Atom_NET_WM_STATE, Atom_NET_WM_STATE_ABOVE, Atom_NET_WM_STATE_BELOW, Atom_NET_WM_STATE_FULLSCREEN, Atom_NET_WM_STATE_MAXIMIZED_HORZ, Atom_NET_WM_STATE_MAXIMIZED_VERT, Atom_NET_WM_STATE_MODAL, Atom_NET_WM_STATE_STAYS_ON_TOP, Atom_NET_WM_STATE_DEMANDS_ATTENTION, Atom_NET_WM_STATE_HIDDEN, Atom_NET_WM_USER_TIME, Atom_NET_WM_USER_TIME_WINDOW, Atom_NET_WM_FULL_PLACEMENT, Atom_NET_WM_WINDOW_TYPE, Atom_NET_WM_WINDOW_TYPE_DESKTOP, Atom_NET_WM_WINDOW_TYPE_DOCK, Atom_NET_WM_WINDOW_TYPE_TOOLBAR, Atom_NET_WM_WINDOW_TYPE_MENU, Atom_NET_WM_WINDOW_TYPE_UTILITY, Atom_NET_WM_WINDOW_TYPE_SPLASH, Atom_NET_WM_WINDOW_TYPE_DIALOG, Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, Atom_NET_WM_WINDOW_TYPE_TOOLTIP, Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, Atom_NET_WM_WINDOW_TYPE_COMBO, Atom_NET_WM_WINDOW_TYPE_DND, Atom_NET_WM_WINDOW_TYPE_NORMAL, Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, Atom_KDE_NET_WM_DESKTOP_FILE, Atom_KDE_NET_WM_FRAME_STRUT, Atom_NET_FRAME_EXTENTS, Atom_NET_STARTUP_INFO, Atom_NET_STARTUP_INFO_BEGIN, Atom_NET_STARTUP_ID, Atom_NET_SUPPORTING_WM_CHECK, Atom_NET_WM_CM_S0, Atom_NET_SYSTEM_TRAY_VISUAL, Atom_NET_ACTIVE_WINDOW, // Property formats AtomTEXT, AtomUTF8_STRING, AtomCARDINAL, // Xdnd AtomXdndEnter, AtomXdndPosition, AtomXdndStatus, AtomXdndLeave, AtomXdndDrop, AtomXdndFinished, AtomXdndTypelist, AtomXdndActionList, AtomXdndSelection, AtomXdndAware, AtomXdndProxy, AtomXdndActionCopy, AtomXdndActionLink, AtomXdndActionMove, AtomXdndActionAsk, AtomXdndActionPrivate, // Xkb Atom_XKB_RULES_NAMES, // XEMBED Atom_XEMBED, Atom_XEMBED_INFO, // XInput2 AtomButtonLeft, AtomButtonMiddle, AtomButtonRight, AtomButtonWheelUp, AtomButtonWheelDown, AtomButtonHorizWheelLeft, AtomButtonHorizWheelRight, AtomAbsMTPositionX, AtomAbsMTPositionY, AtomAbsMTTouchMajor, AtomAbsMTTouchMinor, AtomAbsMTOrientation, AtomAbsMTPressure, AtomAbsMTTrackingID, AtomMaxContacts, AtomRelX, AtomRelY, // XInput2 tablet AtomAbsX, AtomAbsY, AtomAbsPressure, AtomAbsTiltX, AtomAbsTiltY, AtomAbsWheel, AtomAbsDistance, AtomWacomSerialIDs, AtomINTEGER, AtomRelHorizWheel, AtomRelVertWheel, AtomRelHorizScroll, AtomRelVertScroll, Atom_XSETTINGS_SETTINGS, Atom_COMPIZ_DECOR_PENDING, Atom_COMPIZ_DECOR_REQUEST, Atom_COMPIZ_DECOR_DELETE_PIXMAP, Atom_COMPIZ_TOOLKIT_ACTION, Atom_GTK_APPLICATION_ID, Atom_GTK_LOAD_ICONTHEMES, AtomAT_SPI_BUS, AtomEDID, AtomEDID_DATA, AtomXFree86_DDC_EDID1_RAWDATA, Atom_ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbbackingstore.h000066400000000000000000000046441476226662200256730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbclipboard.h000066400000000000000000000067511476226662200251600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbconnection.h000066400000000000000000000347651476226662200253660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbconnection_basic.h000066400000000000000000000107771476226662200265240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbcursor.h000066400000000000000000000054641476226662200245360ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; QSize size() const override; void updateContext(); static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; xcb_cursor_context_t *m_cursorContext; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); bool m_callbackForPropertyRegistered; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbcursorfont.h000066400000000000000000000041441476226662200254170ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // copied from #ifndef QXCBCURSORFONT_H #define QXCBCURSORFONT_H #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* QXCBCURSORFONT_H */ qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbdrag.h000066400000000000000000000120561476226662200241310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbeventdispatcher.h000066400000000000000000000033571476226662200264100ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbeventqueue.h000066400000000000000000000111701476226662200253760ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbexport.h000066400000000000000000000006301476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbimage.h000066400000000000000000000017131476226662200242740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbintegration.h000066400000000000000000000075421476226662200255430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; QPlatformKeyMapper *keyMapper() const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } void setApplicationBadge(qint64 number) override; private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbkeyboard.h000066400000000000000000000055261476226662200250200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject, public QPlatformKeyMapper { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeyCombinations(const QKeyEvent *event) const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbmime.h000066400000000000000000000023541476226662200241430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbnativeinterface.h000066400000000000000000000120101476226662200263510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbobject.h000066400000000000000000000013441476226662200244600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbscreen.h000066400000000000000000000210401476226662200244640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbscrollingdevice_p.h000066400000000000000000000034001476226662200267000ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbsessionmanager.h000066400000000000000000000026471476226662200262370ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbsystemtraytracker.h000066400000000000000000000024251476226662200270130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbvulkaninstance.h000066400000000000000000000021111476226662200262300ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbvulkanwindow.h000066400000000000000000000011141476226662200257350ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbwindow.h000066400000000000000000000236741476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QObject, public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { Q_OBJECT public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); void updateWmTransientFor(); void registerWmTransientForChild(QXcbWindow *); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; QMutex m_mappedMutex; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; bool m_ignorePressedWindowOnMouseLeave = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; QList> m_wmTransientForChildren; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle); ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbwmsupport.h000066400000000000000000000013161476226662200252710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.7.1/qxcbxsettings.h000066400000000000000000000020501476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/000077500000000000000000000000001476226662200221615ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/000077500000000000000000000000001476226662200253515ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/qxcbglintegration.h000066400000000000000000000023701476226662200312500ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATION_H #include "qxcbexport.h" #include "qxcbwindow.h" #include QT_BEGIN_NAMESPACE class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { public: QXcbGlIntegration(); virtual ~QXcbGlIntegration(); virtual bool initialize(QXcbConnection *connection) = 0; virtual bool supportsThreadedOpenGL() const { return false; } virtual bool supportsSwitchableWidgetComposition() const { return true; } virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); virtual QXcbWindow *createWindow(QWindow *window) const = 0; #ifndef QT_NO_OPENGL virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/qxcbglintegrationfactory.h000066400000000000000000000007061476226662200326410ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONFACTORY_H #define QXCBGLINTEGRATIONFACTORY_H #include QT_BEGIN_NAMESPACE class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONFACTORY_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/qxcbglintegrationplugin.h000066400000000000000000000017051476226662200324700ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLINTEGRATIONPLUGIN_H #define QXCBGLINTEGRATIONPLUGIN_H #include "qxcbexport.h" #include #include QT_BEGIN_NAMESPACE #define QXcbGlIntegrationFactoryInterface_iid "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5" class QXcbGlIntegration; class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject { Q_OBJECT public: explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr) : QObject(parent) { } virtual QXcbGlIntegration *create() = 0; // the pattern expected by qLoadPlugin calls for a QString argument. // we don't need it, so don't bother subclasses with it: QXcbGlIntegration *create(const QString &) { return create(); } }; QT_END_NAMESPACE #endif //QXCBGLINTEGRATIONPLUGIN_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/qxcbnativeinterfacehandler.h000066400000000000000000000026471476226662200331160ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACEHANDLER_H #define QXCBNATIVEINTERFACEHANDLER_H #include #include #include "qxcbexport.h" QT_BEGIN_NAMESPACE class QXcbNativeInterface; class Q_XCB_EXPORT QXcbNativeInterfaceHandler { public: QXcbNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); virtual ~QXcbNativeInterfaceHandler(); virtual QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const; virtual QPlatformNativeInterface::NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) const; virtual QFunctionPointer platformFunction(const QByteArray &function) const; protected: QXcbNativeInterface *m_native_interface; }; QT_END_NAMESPACE #endif //QXCBNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl/000077500000000000000000000000001476226662200267545ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl/qxcbeglcontext.h000066400000000000000000000034711476226662200321640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLCONTEXT_H #define QXCBEGLCONTEXT_H #include "qxcbeglwindow.h" #include #include QT_BEGIN_NAMESPACE class QXcbEglContext : public QEGLPlatformContext { public: using QEGLPlatformContext::QEGLPlatformContext; QXcbEglContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(glFormat, share, display, nullptr) { } void swapBuffers(QPlatformSurface *surface) override { QEGLPlatformContext::swapBuffers(surface); if (surface->surface()->surfaceClass() == QSurface::Window) { QXcbWindow *platformWindow = static_cast(surface); // OpenGL context might be bound to a non-gui thread use QueuedConnection to sync // the window from the platformWindow's thread as QXcbWindow is no QObject, an // event is sent to QXcbConnection. (this is faster than a metacall) if (platformWindow->needsSync()) platformWindow->postSyncWindowRequest(); } } bool makeCurrent(QPlatformSurface *surface) override { return QEGLPlatformContext::makeCurrent(surface); } void doneCurrent() override { QEGLPlatformContext::doneCurrent(); } EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast(surface)->eglSurface(); else return static_cast(surface)->pbuffer(); } }; QT_END_NAMESPACE #endif //QXCBEGLCONTEXT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl/qxcbeglinclude.h000066400000000000000000000006451476226662200321230ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINCLUDE_H #define QXCBINCLUDE_H #include #include #include #include #include QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif //QXCBINCLUDE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl/qxcbeglintegration.h000066400000000000000000000032271476226662200330220ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLINTEGRATION_H #define QXCBEGLINTEGRATION_H #include "qxcbglintegration.h" #include "qxcbeglwindow.h" #include #include #include #include #include "qxcbscreen.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler; class QXcbEglIntegration : public QXcbGlIntegration , public QNativeInterface::Private::QEGLIntegration { public: QXcbEglIntegration(); ~QXcbEglIntegration(); bool initialize(QXcbConnection *connection) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool supportsThreadedOpenGL() const override { return true; } EGLDisplay eglDisplay() const { return m_egl_display; } bool usingPlatformDisplay() const { return m_using_platform_display; } xcb_visualid_t getCompatibleVisualId(xcb_screen_t *screen, EGLConfig config) const; private: QXcbConnection *m_connection; EGLDisplay m_egl_display; bool m_using_platform_display; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBEGLINTEGRATION_H qxcbeglnativeinterfacehandler.h000066400000000000000000000023341476226662200351230ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLNATIVEINTERFACEHANDLER_H #define QXCBEGLNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbEglNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { EglDisplay, EglContext, EglConfig }; QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override; private: static void *eglDisplay(); static void *eglDisplayForWindow(QWindow *window); static void *eglContextForContext(QOpenGLContext *context); static void *eglConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBEGLNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_egl/qxcbeglwindow.h000066400000000000000000000015511476226662200320040ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEGLWINDOW_H #define QXCBEGLWINDOW_H #include "qxcbwindow.h" #include "qxcbeglinclude.h" QT_BEGIN_NAMESPACE class QXcbEglIntegration; class QXcbEglWindow : public QXcbWindow { public: QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration); ~QXcbEglWindow(); EGLSurface eglSurface() const { return m_surface; } QXcbEglIntegration *glIntegration() const { return m_glIntegration; } protected: void create() override; void resolveFormat(const QSurfaceFormat &format) override; const xcb_visualtype_t *createVisual() override; private: QXcbEglIntegration *m_glIntegration; EGLConfig m_config; EGLSurface m_surface; }; QT_END_NAMESPACE #endif //QXCBEGLWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_glx/000077500000000000000000000000001476226662200267775ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_glx/qglxintegration.h000066400000000000000000000043431476226662200323730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QGLXINTEGRATION_H #define QGLXINTEGRATION_H #include "qxcbwindow.h" #include "qxcbscreen.h" #include #include #include #include #include QT_BEGIN_NAMESPACE class QGLXContext : public QPlatformOpenGLContext, public QNativeInterface::QGLXContext { public: QGLXContext(Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share); QGLXContext(Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share); ~QGLXContext(); bool makeCurrent(QPlatformSurface *surface) override; void doneCurrent() override; void swapBuffers(QPlatformSurface *surface) override; QFunctionPointer getProcAddress(const char *procName) override; QSurfaceFormat format() const override; bool isSharing() const override; bool isValid() const override; GLXContext nativeContext() const override { return glxContext(); } GLXContext glxContext() const { return m_context; } GLXFBConfig glxConfig() const { return m_config; } static bool supportsThreading(); static void queryDummyContext(); private: Display *m_display = nullptr; GLXFBConfig m_config = nullptr; GLXContext m_context = nullptr; GLXContext m_shareContext = nullptr; QSurfaceFormat m_format; bool m_isPBufferCurrent = false; bool m_ownsContext = false; GLenum (APIENTRY * m_getGraphicsResetStatus)() = nullptr; bool m_lost = false; static bool m_queriedDummyContext; static bool m_supportsThreading; }; class QGLXPbuffer : public QPlatformOffscreenSurface { public: explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface); ~QGLXPbuffer(); QSurfaceFormat format() const override { return m_format; } bool isValid() const override { return m_pbuffer != 0; } GLXPbuffer pbuffer() const { return m_pbuffer; } private: QXcbScreen *m_screen; QSurfaceFormat m_format; Display *m_display; GLXPbuffer m_pbuffer; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_glx/qxcbglxintegration.h000066400000000000000000000024641476226662200330720ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXINTEGRATION_H #define QXCBGLXINTEGRATION_H #include "qxcbglintegration.h" QT_BEGIN_NAMESPACE class QXcbNativeInterfaceHandler; class QXcbGlxIntegration : public QXcbGlIntegration, public QNativeInterface::Private::QGLXIntegration { public: QXcbGlxIntegration(); ~QXcbGlxIntegration(); bool initialize(QXcbConnection *connection) override; bool handleXcbEvent(xcb_generic_event_t *event, uint responseType) override; QXcbWindow *createWindow(QWindow *window) const override; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; bool supportsThreadedOpenGL() const override; bool supportsSwitchableWidgetComposition() const override; private: QXcbConnection *m_connection; uint32_t m_glx_first_event; QScopedPointer m_native_interface_handler; }; QT_END_NAMESPACE #endif //QXCBGLXINTEGRATION_H qxcbglxnativeinterfacehandler.h000066400000000000000000000015251476226662200351720ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_glx// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXNATIVEINTERFACEHANDLER_H #define QXCBGLXNATIVEINTERFACEHANDLER_H #include "qxcbnativeinterfacehandler.h" QT_BEGIN_NAMESPACE class QXcbGlxNativeInterfaceHandler : public QXcbNativeInterfaceHandler { public: enum ResourceType { GLXConfig, GLXContext, }; QXcbGlxNativeInterfaceHandler(QXcbNativeInterface *nativeInterface); QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override; private: static void *glxContextForContext(QOpenGLContext *context); static void *glxConfigForContext(QOpenGLContext *context); }; QT_END_NAMESPACE #endif //QXCBGLXNATIVEINTERFACEHANDLER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/gl_integrations/xcb_glx/qxcbglxwindow.h000066400000000000000000000007531476226662200320550ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBGLXWINDOW_H #define QXCBGLXWINDOW_H #include "qxcbglxintegration.h" #include "qxcbwindow.h" QT_BEGIN_NAMESPACE class QXcbGlxWindow : public QXcbWindow { public: QXcbGlxWindow(QWindow *window); ~QXcbGlxWindow(); protected: const xcb_visualtype_t *createVisual() override; }; QT_END_NAMESPACE #endif //QXCBGLXWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/000077500000000000000000000000001476226662200252015ustar00rootroot00000000000000qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qbackingstore_x11_p.h000066400000000000000000000017151476226662200312220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QBACKINGSTORE_X11_H #define QBACKINGSTORE_X11_H #include typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbNativeBackingStore : public QPlatformBackingStore { public: QXcbNativeBackingStore(QWindow *window); ~QXcbNativeBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; QImage toImage() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion ®ion) override; private: Display *display() const; QPixmap m_pixmap; bool m_translucentBackground; }; QT_END_NAMESPACE #endif // QBACKINGSTORE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qcolormap_x11_p.h000066400000000000000000000015761476226662200303700ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QCOLORMAP_X11_H #define QCOLORMAP_X11_H #include #include QT_BEGIN_NAMESPACE class QXcbColormapPrivate; class QXcbColormap { public: enum Mode { Direct, Indexed, Gray }; static void initialize(); static void cleanup(); static QXcbColormap instance(int screen = -1); QXcbColormap(const QXcbColormap &colormap); ~QXcbColormap(); QXcbColormap &operator=(const QXcbColormap &colormap); Mode mode() const; int depth() const; int size() const; uint pixel(const QColor &color) const; const QColor colorAt(uint pixel) const; const QList colormap() const; private: QXcbColormap(); QXcbColormapPrivate *d; }; QT_END_NAMESPACE #endif // QCOLORMAP_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qpaintengine_x11_p.h000066400000000000000000000056521476226662200310540ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPAINTENGINE_X11_H #define QPAINTENGINE_X11_H #include typedef unsigned long XID; typedef XID Drawable; typedef struct _XGC *GC; QT_BEGIN_NAMESPACE extern "C" { Drawable qt_x11Handle(const QPaintDevice *pd); GC qt_x11_get_pen_gc(QPainter *); GC qt_x11_get_brush_gc(QPainter *); } class QX11PaintEnginePrivate; class QX11PaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QX11PaintEngine) public: QX11PaintEngine(); ~QX11PaintEngine(); bool begin(QPaintDevice *pdev) override; bool end() override; void updateState(const QPaintEngineState &state) override; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush, const QPointF &pt); void updateRenderHints(QPainter::RenderHints hints); void updateFont(const QFont &font); void updateMatrix(const QTransform &matrix); void updateClipRegion_dev(const QRegion ®ion, Qt::ClipOperation op); void drawLines(const QLine *lines, int lineCount) override; void drawLines(const QLineF *lines, int lineCount) override; void drawRects(const QRect *rects, int rectCount) override; void drawRects(const QRectF *rects, int rectCount) override; void drawPoints(const QPoint *points, int pointCount) override; void drawPoints(const QPointF *points, int pointCount) override; void drawEllipse(const QRect &r) override; void drawEllipse(const QRectF &r) override; virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override { QPaintEngine::drawPolygon(points, pointCount, mode); } void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; void drawPath(const QPainterPath &path) override; void drawTextItem(const QPointF &p, const QTextItem &textItem) override; void drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override; virtual Drawable handle() const; inline Type type() const override { return QPaintEngine::X11; } QPainter::RenderHints supportedRenderHints() const; protected: QX11PaintEngine(QX11PaintEnginePrivate &dptr); #if QT_CONFIG(fontconfig) void drawFreetype(const QPointF &p, const QTextItemInt &ti); bool drawCachedGlyphs(const QTransform &transform, const QTextItemInt &ti); #endif // QT_CONFIG(fontconfig) friend class QPixmap; friend class QFontEngineBox; friend GC qt_x11_get_pen_gc(QPainter *); friend GC qt_x11_get_brush_gc(QPainter *); private: Q_DISABLE_COPY_MOVE(QX11PaintEngine) }; QT_END_NAMESPACE #endif // QPAINTENGINE_X11_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qpixmap_x11_p.h000066400000000000000000000075411476226662200300500ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QX11PLATFORMPIXMAP_H #define QX11PLATFORMPIXMAP_H #include #include #include #include "qxcbnativepainting.h" typedef unsigned long XID; typedef XID Drawable; typedef XID Picture; typedef XID Pixmap; QT_BEGIN_NAMESPACE class QX11PaintEngine; struct QXImageWrapper; class QX11PlatformPixmap : public QPlatformPixmap { public: QX11PlatformPixmap(PixelType pixelType); ~QX11PlatformPixmap(); QPlatformPixmap *createCompatiblePlatformPixmap() const override; void resize(int width, int height) override; void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override; void copy(const QPlatformPixmap *data, const QRect &rect) override; bool scroll(int dx, int dy, const QRect &rect) override; int metric(QPaintDevice::PaintDeviceMetric metric) const override; void fill(const QColor &fillColor) override; QBitmap mask() const override; void setMask(const QBitmap &mask) override; bool hasAlphaChannel() const override; QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override; QImage toImage() const override; QImage toImage(const QRect &rect) const override; QPaintEngine *paintEngine() const override; qreal devicePixelRatio() const override; void setDevicePixelRatio(qreal scaleFactor) override; inline Drawable handle() const { return hd; } inline Picture x11PictureHandle() const { return picture; } inline const QXcbX11Info *x11_info() const { return &xinfo; } Pixmap x11ConvertToDefaultDepth(); static XID createBitmapFromImage(const QImage &image); #if QT_CONFIG(xrender) void convertToARGB32(bool preserveContents = true); #endif bool isBackingStore() const; void setIsBackingStore(bool on); private: friend class QX11PaintEngine; friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap); friend void qt_x11SetScreen(QPixmap &pixmap, int screen); void release(); QImage toImage(const QXImageWrapper &xi, const QRect &rect) const; QBitmap mask_to_bitmap(int screen) const; static Pixmap bitmap_to_mask(const QBitmap &, int screen); void bitmapFromImage(const QImage &image); bool canTakeQImageFromXImage(const QXImageWrapper &xi) const; QImage takeQImageFromXImage(const QXImageWrapper &xi) const; Pixmap hd = 0; enum Flag { NoFlags = 0x0, Uninitialized = 0x1, Readonly = 0x2, InvertedWhenBoundToTexture = 0x4, GlSurfaceCreatedWithAlpha = 0x8, IsBackingStore = 0x10 }; uint flags; QXcbX11Info xinfo; Pixmap x11_mask; Picture picture; Picture mask_picture; Pixmap hd2; // sorted in the default display depth //QPixmap::ShareMode share_mode; qreal dpr; QX11PaintEngine *pengine; }; inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->x11PictureHandle(); return 0; } inline Pixmap qt_x11PixmapHandle(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) return pm->handle(); return 0; } inline const QXcbX11Info &qt_x11Info(const QPixmap &pixmap) { if (QX11PlatformPixmap *pm = qt_x11Pixmap(pixmap)) { return pm->xinfo; } else { static QXcbX11Info nullX11Info; return nullX11Info; } } int qt_x11SetDefaultScreen(int screen); void qt_x11SetScreen(QPixmap &pixmap, int screen); QT_END_NAMESPACE #endif // QX11PLATFORMPIXMAP_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qpolygonclipper_p.h000066400000000000000000000200031476226662200311130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPOLYGONCLIPPER_P_H #define QPOLYGONCLIPPER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include QT_BEGIN_NAMESPACE /* based on sutherland-hodgman line-by-line clipping, as described in Computer Graphics and Principles */ template class QPolygonClipper { public: QPolygonClipper() : buffer1(0), buffer2(0) { x1 = y1 = x2 = y2 = 0; } ~QPolygonClipper() { } void setBoundingRect(const QRect bounds) { x1 = bounds.x(); x2 = bounds.x() + bounds.width(); y1 = bounds.y(); y2 = bounds.y() + bounds.height(); } QRect boundingRect() { return QRect(QPoint(x1, y1), QPoint(x2, y2)); } inline OutType intersectLeft(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x1; t.y = static_cast(p2.y + (x1 - p2.x) * dy); return t; } inline OutType intersectRight(const OutType &p1, const OutType &p2) { OutType t; qreal dy = (p1.y - p2.y) / qreal(p1.x - p2.x); t.x = x2; t.y = static_cast(p2.y + (x2 - p2.x) * dy); return t; } inline OutType intersectTop(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y1 - p2.y) * dx); t.y = y1; return t; } inline OutType intersectBottom(const OutType &p1, const OutType &p2) { OutType t; qreal dx = (p1.x - p2.x) / qreal(p1.y - p2.y); t.x = static_cast(p2.x + (y2 - p2.y) * dx); t.y = y2; return t; } void clipPolygon(const InType *inPoints, int inCount, OutType **outPoints, int *outCount, bool closePolygon = true) { Q_ASSERT(outPoints); Q_ASSERT(outCount); if (inCount < 2) { *outCount = 0; return; } buffer1.reset(); buffer2.reset(); QDataBuffer *source = &buffer1; QDataBuffer *clipped = &buffer2; // Gather some info since we are iterating through the points anyway.. bool doLeft = false, doRight = false, doTop = false, doBottom = false; OutType ot; for (int i=0; iadd(ot); if (ot.x < x1) doLeft = true; else if (ot.x > x2) doRight = true; if (ot.y < y1) doTop = true; else if (ot.y > y2) doBottom = true; } if (doLeft && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x >= x1) clipped->add(source->at(0)); } for (int i=start; iat(i); const OutType &ppt = source->at(lastPos); if (cpt.x >= x1) { if (ppt.x >= x1) { clipped->add(cpt); } else { clipped->add(intersectLeft(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x >= x1) { clipped->add(intersectLeft(cpt, ppt)); } lastPos = i; } } if (doRight && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).x <= x2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.x <= x2) { if (ppt.x <= x2) { clipped->add(cpt); } else { clipped->add(intersectRight(cpt, ppt)); clipped->add(cpt); } } else if (ppt.x <= x2) { clipped->add(intersectRight(cpt, ppt)); } lastPos = i; } } if (doTop && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y >= y1) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y >= y1) { if (ppt.y >= y1) { clipped->add(cpt); } else { clipped->add(intersectTop(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y >= y1) { clipped->add(intersectTop(cpt, ppt)); } lastPos = i; } } if (doBottom && clipped->size() > 1) { QDataBuffer *tmp = source; source = clipped; clipped = tmp; clipped->reset(); int lastPos, start; if (closePolygon) { lastPos = source->size() - 1; start = 0; } else { lastPos = 0; start = 1; if (source->at(0).y <= y2) clipped->add(source->at(0)); } for (int i=start; isize(); ++i) { const OutType &cpt = source->at(i); const OutType &ppt = source->at(lastPos); if (cpt.y <= y2) { if (ppt.y <= y2) { clipped->add(cpt); } else { clipped->add(intersectBottom(cpt, ppt)); clipped->add(cpt); } } else if (ppt.y <= y2) { clipped->add(intersectBottom(cpt, ppt)); } lastPos = i; } } if (closePolygon && clipped->size() > 0) { // close clipped polygon if (clipped->at(0).x != clipped->at(clipped->size()-1).x || clipped->at(0).y != clipped->at(clipped->size()-1).y) { OutType ot = clipped->at(0); clipped->add(ot); } } *outCount = clipped->size(); *outPoints = clipped->data(); } private: int x1, x2, y1, y2; QDataBuffer buffer1; QDataBuffer buffer2; }; QT_END_NAMESPACE #endif // QPOLYGONCLIPPER_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qt_x11_p.h000066400000000000000000000067561476226662200270240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_X11_P_H #define QT_X11_P_H #define register /* C++17 deprecated register */ #include #include #undef register #if QT_CONFIG(xrender) # include "qtessellator_p.h" # include #endif #if QT_CONFIG(fontconfig) #include #endif #if defined(FT_LCD_FILTER_H) #include FT_LCD_FILTER_H #endif #if defined(FC_LCD_FILTER) #ifndef FC_LCD_FILTER_NONE #define FC_LCD_FILTER_NONE FC_LCD_NONE #endif #ifndef FC_LCD_FILTER_DEFAULT #define FC_LCD_FILTER_DEFAULT FC_LCD_DEFAULT #endif #ifndef FC_LCD_FILTER_LIGHT #define FC_LCD_FILTER_LIGHT FC_LCD_LIGHT #endif #ifndef FC_LCD_FILTER_LEGACY #define FC_LCD_FILTER_LEGACY FC_LCD_LEGACY #endif #endif QT_BEGIN_NAMESPACE // rename a couple of X defines to get rid of name clashes // resolve the conflict between X11's FocusIn and QEvent::FocusIn enum { XFocusOut = FocusOut, XFocusIn = FocusIn, XKeyPress = KeyPress, XKeyRelease = KeyRelease, XNone = None, XRevertToParent = RevertToParent, XGrayScale = GrayScale, XCursorShape = CursorShape, }; #undef FocusOut #undef FocusIn #undef KeyPress #undef KeyRelease #undef None #undef RevertToParent #undef GrayScale #undef CursorShape #ifdef FontChange #undef FontChange #endif Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE); #if QT_CONFIG(xrender) Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE); #endif struct QX11InfoData; enum DesktopEnvironment { DE_UNKNOWN, DE_KDE, DE_GNOME, DE_CDE, DE_MEEGO_COMPOSITOR, DE_4DWM }; struct QXcbX11Data { Display *display = nullptr; // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display bool use_xrender = false; int xrender_major = 0; int xrender_version = 0; QX11InfoData *screens = nullptr; Visual **argbVisuals = nullptr; Colormap *argbColormaps = nullptr; int screenCount = 0; int defaultScreen = 0; // options int visual_class = 0; int visual_id = 0; int color_count = 0; bool custom_cmap = false; // outside visual/colormap Visual *visual = nullptr; Colormap colormap = 0; #if QT_CONFIG(xrender) enum { solid_fill_count = 16 }; struct SolidFills { XRenderColor color; int screen; Picture picture; } solid_fills[solid_fill_count]; enum { pattern_fill_count = 16 }; struct PatternFills { XRenderColor color; XRenderColor bg_color; int screen; int style; bool opaque; Picture picture; } pattern_fills[pattern_fill_count]; Picture getSolidFill(int screen, const QColor &c); XRenderColor preMultiply(const QColor &c); #endif bool fc_antialias = true; int fc_hint_style = 0; DesktopEnvironment desktopEnvironment = DE_GNOME; }; extern QXcbX11Data *qt_x11Data; #define X11 qt_x11Data struct QX11InfoData { int screen; int dpiX; int dpiY; int depth; int cells; Colormap colormap; Visual *visual; bool defaultColormap; bool defaultVisual; int subpixel = 0; }; template constexpr inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; } QT_END_NAMESPACE #endif // QT_X11_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qtessellator_p.h000066400000000000000000000022761476226662200304220ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTESSELATOR_P_H #define QTESSELATOR_P_H #include #include QT_BEGIN_NAMESPACE class QTessellatorPrivate; typedef int Q27Dot5; #define Q27Dot5ToDouble(i) ((i)/32.) #define FloatToQ27Dot5(i) (int)((i) * 32) #define IntToQ27Dot5(i) ((i) << 5) #define Q27Dot5ToXFixed(i) ((i) << 11) #define Q27Dot5Factor 32 class QTessellator { public: QTessellator(); virtual ~QTessellator(); QRectF tessellate(const QPointF *points, int nPoints); void tessellateConvex(const QPointF *points, int nPoints); void tessellateRect(const QPointF &a, const QPointF &b, qreal width); void setWinding(bool w); struct Vertex { Q27Dot5 x; Q27Dot5 y; }; struct Trapezoid { Q27Dot5 top; Q27Dot5 bottom; const Vertex *topLeft; const Vertex *bottomLeft; const Vertex *topRight; const Vertex *bottomRight; }; virtual void addTrap(const Trapezoid &trap) = 0; private: friend class QTessellatorPrivate; QTessellatorPrivate *d; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/nativepainting/qxcbnativepainting.h000066400000000000000000000032421476226662200312510ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEPAINTING_H #define QXCBNATIVEPAINTING_H #include #include "qt_x11_p.h" typedef struct _FcPattern FcPattern; typedef unsigned long XID; typedef XID Colormap; typedef XID Window; typedef struct _XDisplay Display; QT_BEGIN_NAMESPACE class QXcbConnection; class QPixmap; void qt_xcb_native_x11_info_init(QXcbConnection *conn); QList qt_region_to_xrectangles(const QRegion &r); class QXcbX11InfoData; class QXcbX11Info { public: QXcbX11Info(); ~QXcbX11Info(); QXcbX11Info(const QXcbX11Info &other); QXcbX11Info &operator=(const QXcbX11Info &other); static QXcbX11Info fromScreen(int screen); static Display *display(); int depth() const; void setDepth(int depth); int screen() const; Colormap colormap() const; void *visual() const; void setVisual(void *visual); static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Colormap appColormap(int screen = -1); static void *appVisual(int screen = -1); static Window appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); private: QSharedDataPointer d; friend class QX11PaintEngine; friend class QX11PlatformPixmap; friend void qt_x11SetScreen(QPixmap &pixmap, int screen); }; QT_END_NAMESPACE #endif // QXCBNATIVEPAINTING_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qt_xlib_wrapper.h000066400000000000000000000005571476226662200255430ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QT_XLIB_WRAPPER_H #define QT_XLIB_WRAPPER_H #ifdef __cplusplus extern "C" { #endif typedef struct _XDisplay Display; void qt_XFlush(Display *dpy); #ifdef __cplusplus } #endif #endif // QT_XLIB_WRAPPER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbatom.h000066400000000000000000000127261476226662200241600ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBATOM_H #define QXCBATOM_H #include class QXcbAtom { public: enum Atom { // window-manager <-> client protocols AtomWM_PROTOCOLS, AtomWM_DELETE_WINDOW, AtomWM_TAKE_FOCUS, Atom_NET_WM_PING, Atom_NET_WM_CONTEXT_HELP, Atom_NET_WM_SYNC_REQUEST, Atom_NET_WM_SYNC_REQUEST_COUNTER, AtomMANAGER, // System tray notification Atom_NET_SYSTEM_TRAY_OPCODE, // System tray operation // ICCCM window state AtomWM_STATE, AtomWM_CHANGE_STATE, AtomWM_CLASS, AtomWM_NAME, // Session management AtomWM_CLIENT_LEADER, AtomWM_WINDOW_ROLE, AtomSM_CLIENT_ID, AtomWM_CLIENT_MACHINE, // Clipboard AtomCLIPBOARD, AtomINCR, AtomTARGETS, AtomMULTIPLE, AtomTIMESTAMP, AtomSAVE_TARGETS, AtomCLIP_TEMPORARY, Atom_QT_SELECTION, Atom_QT_CLIPBOARD_SENTINEL, Atom_QT_SELECTION_SENTINEL, AtomCLIPBOARD_MANAGER, AtomRESOURCE_MANAGER, Atom_XSETROOT_ID, Atom_QT_SCROLL_DONE, Atom_QT_INPUT_ENCODING, // Qt/XCB specific Atom_QT_CLOSE_CONNECTION, Atom_QT_GET_TIMESTAMP, Atom_MOTIF_WM_HINTS, AtomDTWM_IS_RUNNING, AtomENLIGHTENMENT_DESKTOP, Atom_DT_SAVE_MODE, Atom_SGI_DESKS_MANAGER, // EWMH (aka NETWM) Atom_NET_SUPPORTED, Atom_NET_VIRTUAL_ROOTS, Atom_NET_WORKAREA, Atom_NET_MOVERESIZE_WINDOW, Atom_NET_WM_MOVERESIZE, Atom_NET_WM_NAME, Atom_NET_WM_ICON_NAME, Atom_NET_WM_ICON, Atom_NET_WM_PID, Atom_NET_WM_WINDOW_OPACITY, Atom_NET_WM_STATE, Atom_NET_WM_STATE_ABOVE, Atom_NET_WM_STATE_BELOW, Atom_NET_WM_STATE_FULLSCREEN, Atom_NET_WM_STATE_MAXIMIZED_HORZ, Atom_NET_WM_STATE_MAXIMIZED_VERT, Atom_NET_WM_STATE_MODAL, Atom_NET_WM_STATE_STAYS_ON_TOP, Atom_NET_WM_STATE_DEMANDS_ATTENTION, Atom_NET_WM_STATE_HIDDEN, Atom_NET_WM_USER_TIME, Atom_NET_WM_USER_TIME_WINDOW, Atom_NET_WM_FULL_PLACEMENT, Atom_NET_WM_WINDOW_TYPE, Atom_NET_WM_WINDOW_TYPE_DESKTOP, Atom_NET_WM_WINDOW_TYPE_DOCK, Atom_NET_WM_WINDOW_TYPE_TOOLBAR, Atom_NET_WM_WINDOW_TYPE_MENU, Atom_NET_WM_WINDOW_TYPE_UTILITY, Atom_NET_WM_WINDOW_TYPE_SPLASH, Atom_NET_WM_WINDOW_TYPE_DIALOG, Atom_NET_WM_WINDOW_TYPE_DROPDOWN_MENU, Atom_NET_WM_WINDOW_TYPE_POPUP_MENU, Atom_NET_WM_WINDOW_TYPE_TOOLTIP, Atom_NET_WM_WINDOW_TYPE_NOTIFICATION, Atom_NET_WM_WINDOW_TYPE_COMBO, Atom_NET_WM_WINDOW_TYPE_DND, Atom_NET_WM_WINDOW_TYPE_NORMAL, Atom_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, Atom_KDE_NET_WM_DESKTOP_FILE, Atom_KDE_NET_WM_FRAME_STRUT, Atom_NET_FRAME_EXTENTS, Atom_NET_STARTUP_INFO, Atom_NET_STARTUP_INFO_BEGIN, Atom_NET_STARTUP_ID, Atom_NET_SUPPORTING_WM_CHECK, Atom_NET_WM_CM_S0, Atom_NET_SYSTEM_TRAY_VISUAL, Atom_NET_ACTIVE_WINDOW, // Property formats AtomTEXT, AtomUTF8_STRING, AtomCARDINAL, // Xdnd AtomXdndEnter, AtomXdndPosition, AtomXdndStatus, AtomXdndLeave, AtomXdndDrop, AtomXdndFinished, AtomXdndTypelist, AtomXdndActionList, AtomXdndSelection, AtomXdndAware, AtomXdndProxy, AtomXdndActionCopy, AtomXdndActionLink, AtomXdndActionMove, AtomXdndActionAsk, AtomXdndActionPrivate, // Xkb Atom_XKB_RULES_NAMES, // XEMBED Atom_XEMBED, Atom_XEMBED_INFO, // XInput2 AtomButtonLeft, AtomButtonMiddle, AtomButtonRight, AtomButtonWheelUp, AtomButtonWheelDown, AtomButtonHorizWheelLeft, AtomButtonHorizWheelRight, AtomAbsMTPositionX, AtomAbsMTPositionY, AtomAbsMTTouchMajor, AtomAbsMTTouchMinor, AtomAbsMTOrientation, AtomAbsMTPressure, AtomAbsMTTrackingID, AtomMaxContacts, AtomRelX, AtomRelY, // XInput2 tablet AtomAbsX, AtomAbsY, AtomAbsPressure, AtomAbsTiltX, AtomAbsTiltY, AtomAbsWheel, AtomAbsDistance, AtomWacomSerialIDs, AtomINTEGER, AtomRelHorizWheel, AtomRelVertWheel, AtomRelHorizScroll, AtomRelVertScroll, Atom_XSETTINGS_SETTINGS, Atom_COMPIZ_DECOR_PENDING, Atom_COMPIZ_DECOR_REQUEST, Atom_COMPIZ_DECOR_DELETE_PIXMAP, Atom_COMPIZ_TOOLKIT_ACTION, Atom_GTK_APPLICATION_ID, Atom_GTK_LOAD_ICONTHEMES, AtomAT_SPI_BUS, AtomEDID, AtomEDID_DATA, AtomXFree86_DDC_EDID1_RAWDATA, Atom_ICC_PROFILE, NAtoms }; QXcbAtom(); void initialize(xcb_connection_t *connection); inline xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_allAtoms[atom]; } QXcbAtom::Atom qatom(xcb_atom_t atom) const; protected: void initializeAllAtoms(xcb_connection_t *connection); private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; }; #endif // QXCBATOM_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbbackingstore.h000066400000000000000000000046441476226662200256730ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBACKINGSTORE_H #define QXCBBACKINGSTORE_H #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbBackingStoreImage; class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore { public: QXcbBackingStore(QWindow *window); ~QXcbBackingStore(); QPaintDevice *paintDevice() override; void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; QImage toImage() const override; QPlatformGraphicsBuffer *graphicsBuffer() const override; void resize(const QSize &size, const QRegion &staticContents) override; bool scroll(const QRegion &area, int dx, int dy) override; void beginPaint(const QRegion &) override; void endPaint() override; static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1, void *shmInfo = nullptr); protected: virtual void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset); virtual void recreateImage(QXcbWindow *win, const QSize &size); QXcbBackingStoreImage *m_image = nullptr; QStack m_paintRegions; QImage m_rgbImage; }; class QXcbSystemTrayBackingStore : public QXcbBackingStore { public: QXcbSystemTrayBackingStore(QWindow *window); ~QXcbSystemTrayBackingStore(); void beginPaint(const QRegion &) override; protected: void render(xcb_window_t window, const QRegion ®ion, const QPoint &offset) override; void recreateImage(QXcbWindow *win, const QSize &size) override; private: void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbclipboard.h000066400000000000000000000070261476226662200251540ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include #include #include #include #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboard; class QXcbClipboardMime; class QXcbClipboardTransaction : public QObject { Q_OBJECT public: QXcbClipboardTransaction(QXcbClipboard *clipboard, xcb_window_t w, xcb_atom_t p, QByteArray d, xcb_atom_t t, int f); ~QXcbClipboardTransaction(); bool updateIncrementalProperty(const xcb_property_notify_event_t *event); protected: void timerEvent(QTimerEvent *ev) override; private: QXcbClipboard *m_clipboard; xcb_window_t m_window; xcb_atom_t m_property; QByteArray m_data; xcb_atom_t m_target; uint8_t m_format; uint m_offset = 0; int m_abortTimerId = 0; }; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); std::optional clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); std::optional getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); bool handlePropertyNotify(const xcb_generic_event_t *event); std::optional getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); int increment() const { return m_maxPropertyRequestDataBytes; } int clipboardTimeout() const { return clipboard_timeout; } void removeTransaction(xcb_window_t window) { m_transactions.remove(window); } private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t window, int type, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; static const int clipboard_timeout; int m_maxPropertyRequestDataBytes = 0; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; using TransactionMap = QMap; TransactionMap m_transactions; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbconnection.h000066400000000000000000000347651476226662200253660ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCONNECTION_H #define QXCBCONNECTION_H #include #include #include #include #include #include "qxcbexport.h" #include #include #include #include #include #include "qxcbeventqueue.h" #include "qxcbconnection_basic.h" #if QT_CONFIG(tabletevent) #include #endif QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents) Q_DECLARE_LOGGING_CATEGORY(lcQpaPeeker) Q_DECLARE_LOGGING_CATEGORY(lcQpaKeyboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaClipboard) Q_DECLARE_LOGGING_CATEGORY(lcQpaXDnd) Q_DECLARE_LOGGING_CATEGORY(lcQpaEventReader) class QXcbVirtualDesktop; class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; class QXcbScrollingDevice; class QXcbScrollingDevicePrivate; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; class QXcbSystemTrayTracker; class QXcbGlIntegration; class QXcbWindowEventListener { public: virtual ~QXcbWindowEventListener() {} virtual bool handleNativeEvent(xcb_generic_event_t *) { return false; } virtual void handleExposeEvent(const xcb_expose_event_t *) {} virtual void handleClientMessageEvent(const xcb_client_message_event_t *) {} virtual void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *) {} virtual void handleMapNotifyEvent(const xcb_map_notify_event_t *) {} virtual void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *) {} virtual void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) {} virtual void handleButtonPressEvent(const xcb_button_press_event_t *) {} virtual void handleButtonReleaseEvent(const xcb_button_release_event_t *) {} virtual void handleMotionNotifyEvent(const xcb_motion_notify_event_t *) {} virtual void handleEnterNotifyEvent(const xcb_enter_notify_event_t *) {} virtual void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *) {} virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} virtual QXcbWindow *toWindow() { return nullptr; } }; typedef QHash WindowMapper; class QXcbSyncWindowRequest : public QEvent { public: QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { } QXcbWindow *window() const { return m_window; } void invalidate(); private: QXcbWindow *m_window; }; class Q_XCB_EXPORT QXcbConnection : public QXcbBasicConnection { Q_OBJECT public: QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName = nullptr); ~QXcbConnection(); QXcbConnection *connection() const { return const_cast(this); } QXcbEventQueue *eventQueue() const { return m_eventQueue; } const QList &virtualDesktops() const { return m_virtualDesktops; } const QList &screens() const { return m_screens; } QXcbVirtualDesktop *primaryVirtualDesktop() const { return m_virtualDesktops.value(primaryScreenNumber()); } QXcbScreen *primaryScreen() const; const xcb_format_t *formatForDepth(uint8_t depth) const; bool imageNeedsEndianSwap() const { if (!hasShm()) return false; // The non-Shm path does its own swapping #if Q_BYTE_ORDER == Q_BIG_ENDIAN return setup()->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST; #else return setup()->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST; #endif } QXcbKeyboard *keyboard() const { return m_keyboard; } #ifndef QT_NO_CLIPBOARD QXcbClipboard *clipboard() const { return m_clipboard; } #endif #if QT_CONFIG(draganddrop) QXcbDrag *drag() const { return m_drag; } #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } xcb_window_t rootWindow(); xcb_window_t clientLeader(); bool hasDefaultVisualId() const { return m_defaultVisualId != UINT_MAX; } xcb_visualid_t defaultVisualId() const { return m_defaultVisualId; } void sync(); void handleXcbError(xcb_generic_error_t *error); void printXcbError(const char *message, xcb_generic_error_t *error); void handleXcbEvent(xcb_generic_event_t *event); void printXcbEvent(const QLoggingCategory &log, const char *message, xcb_generic_event_t *event) const; void addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener); void removeWindowEventListener(xcb_window_t id); QXcbWindowEventListener *windowEventListenerFromId(xcb_window_t id); QXcbWindow *platformWindowFromId(xcb_window_t id); inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; } inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; } xcb_timestamp_t getTimestamp(); xcb_window_t selectionOwner(xcb_atom_t atom) const; xcb_window_t qtSelectionOwner(); void setButtonState(Qt::MouseButton button, bool down); Qt::MouseButtons buttonState() const { return m_buttonState; } Qt::MouseButton button() const { return m_button; } Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } void setMousePressWindow(QXcbWindow *); QByteArray startupId() const; void setStartupId(const QByteArray &nextId); void grabServer(); void ungrabServer(); QString windowManagerName() const; QXcbNativeInterface *nativeInterface() const { return m_nativeInterface; } QXcbSystemTrayTracker *systemTrayTracker() const; Qt::MouseButtons queryMouseButtons() const; bool isUserInputEvent(xcb_generic_event_t *event) const; void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); Qt::MouseButton xiToQtMouseButton(uint32_t b); void xi2UpdateScrollingDevices(); bool isTouchScreen(int id); bool startSystemMoveResizeForTouch(xcb_window_t window, int edges); void abortSystemMoveResize(xcb_window_t window); bool isDuringSystemMoveResize() const; void setDuringSystemMoveResize(bool during); bool canGrab() const { return m_canGrabServer; } QXcbGlIntegration *glIntegration() const; void flush() { xcb_flush(xcb_connection()); } void processXcbEvents(QEventLoop::ProcessEventsFlags flags); QTimer &focusInTimer() { return m_focusInTimer; } protected: bool event(QEvent *e) override; private: void xrandrSelectEvents(); QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const; QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const; QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow) const; void updateScreens(const xcb_randr_notify_event_t *event); bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, const xcb_randr_output_change_t &outputChange, xcb_randr_get_output_info_reply_t *outputInfo); void destroyScreen(QXcbScreen *screen); void initializeScreens(bool initialized); void initializeScreensWithoutXRandR(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void initializeScreensFromOutput(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen); void updateScreen_monitor(QXcbScreen *screen, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbScreen *createScreen_monitor(QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QXcbVirtualDesktop* virtualDesktopForNumber(int n) const; QXcbScreen* findScreenForMonitorInfo(const QList &screens, xcb_randr_monitor_info_t *monitorInfo); void initializeScreensFromMonitor(xcb_screen_iterator_t *it, int screenNumber, QXcbScreen **primaryScreen, bool initialized); bool compressEvent(xcb_generic_event_t *event) const; inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr); void xi2SetupDevices(); // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate struct TouchDeviceData { QPointingDevice *qtTouchDevice = nullptr; QHash touchPoints; QHash pointPressedPosition; // in screen coordinates where each point was pressed struct ValuatorClassInfo { double min = 0; double max = 0; int number = -1; QXcbAtom::Atom label; }; QList valuatorInfo; // Stuff that is relevant only for touchpads QPointF firstPressedPosition; // in screen coordinates where the first point was pressed QPointF firstPressedNormalPosition; // device coordinates (0 to 1, 0 to 1) where the first point was pressed QSizeF size; // device size in mm bool providesTouchOrientation = false; }; TouchDeviceData *populateTouchDevices(void *info, QXcbScrollingDevicePrivate *scrollingDeviceP, bool *used = nullptr); TouchDeviceData *touchDeviceForId(int id); void xi2HandleEvent(xcb_ge_event_t *event); void xi2HandleGesturePinchEvent(void *event); void xi2HandleGestureSwipeEvent(void *event); void xi2HandleHierarchyEvent(void *event); void xi2HandleDeviceChangedEvent(void *event); void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow); #if QT_CONFIG(tabletevent) // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll) struct TabletData { int deviceId = 0; QString name; QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown; QInputDevice::DeviceType tool = QInputDevice::DeviceType::Stylus; Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { double minVal = 0; double maxVal = 0; double curVal = 0; int number = -1; }; QHash valuatorInfo; }; friend class QTypeInfo; friend class QTypeInfo; bool xi2HandleTabletEvent(const void *event, TabletData *tabletData); void xi2ReportTabletEvent(const void *event, TabletData *tabletData); QList m_tabletData; TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); QHash m_touchDevices; struct StartSystemMoveResizeInfo { xcb_window_t window = XCB_NONE; uint16_t deviceid; uint32_t pointid; int edges; } m_startSystemMoveResizeInfo; bool m_duringSystemMoveResize; const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; QList m_virtualDesktops; QList m_screens; xcb_timestamp_t m_time = XCB_CURRENT_TIME; xcb_timestamp_t m_netWmUserTime = XCB_CURRENT_TIME; QXcbKeyboard *m_keyboard = nullptr; #ifndef QT_NO_CLIPBOARD QXcbClipboard *m_clipboard = nullptr; #endif #if QT_CONFIG(draganddrop) QXcbDrag *m_drag = nullptr; #endif QScopedPointer m_wmSupport; QXcbNativeInterface *m_nativeInterface = nullptr; QXcbEventQueue *m_eventQueue = nullptr; WindowMapper m_mapper; Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; QXcbWindow *m_mouseGrabber = nullptr; QXcbWindow *m_mousePressWindow = nullptr; #if QT_CONFIG(gestures) qreal m_lastPinchScale = 0; #endif xcb_window_t m_clientLeader = 0; QByteArray m_startupId; QXcbSystemTrayTracker *m_systemTrayTracker = nullptr; mutable QXcbGlIntegration *m_glIntegration = nullptr; mutable bool m_glIntegrationInitialized = false; bool m_xiGrab = false; QList m_xiMasterPointerIds; QList m_xiSlavePointerIds; xcb_window_t m_qtSelectionOwner = 0; friend class QXcbEventQueue; QTimer m_focusInTimer; }; #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_RELOCATABLE_TYPE); #endif class QXcbConnectionGrabber { public: Q_NODISCARD_CTOR QXcbConnectionGrabber(QXcbConnection *connection); ~QXcbConnectionGrabber(); void release(); private: QXcbConnection *m_connection; }; // The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the // passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into // unrelated memory. template struct alignas(32) q_padded_xcb_event : T { }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbconnection_basic.h000066400000000000000000000107771476226662200265240ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBBASICCONNECTION_H #define QXCBBASICCONNECTION_H #include "qxcbatom.h" #include "qxcbexport.h" #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb) class Q_XCB_EXPORT QXcbBasicConnection : public QObject { Q_OBJECT public: QXcbBasicConnection(const char *displayName); ~QXcbBasicConnection(); #if QT_CONFIG(xcb_xlib) void *xlib_display() const { return m_xlibDisplay; } #endif const char *displayName() const { return m_displayName.constData(); } int primaryScreenNumber() const { return m_primaryScreenNumber; } xcb_connection_t *xcb_connection() const { return m_xcbConnection; } bool isConnected() const { return m_xcbConnection && !xcb_connection_has_error(m_xcbConnection); } const xcb_setup_t *setup() const { return m_setup; } size_t maxRequestDataBytes(size_t requestSize) const; inline xcb_atom_t atom(QXcbAtom::Atom qatom) const { return m_xcbAtom.atom(qatom); } QXcbAtom::Atom qatom(xcb_atom_t atom) const { return m_xcbAtom.qatom(atom); } xcb_atom_t internAtom(const char *name); QByteArray atomName(xcb_atom_t atom); bool hasXFixes() const { return m_hasXFixes; } bool hasXShape() const { return m_hasXhape; } bool hasXRandr() const { return m_hasXRandr; } bool hasInputShape() const { return m_hasInputShape; } bool hasXKB() const { return m_hasXkb; } bool hasXRender(int major = -1, int minor = -1) const { if (m_hasXRender && major != -1 && minor != -1) return m_xrenderVersion >= qMakePair(major, minor); return m_hasXRender; } bool hasXInput2() const { return m_xi2Enabled; } bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } bool hasBigRequest() const; bool isAtLeastXRandR12() const { return m_hasXRandr && m_xrandr1Minor >= 2; } bool isAtLeastXRandR15() const { return m_hasXRandr && m_xrandr1Minor >= 5; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isAtLeastXI24() const { return m_xi2Enabled && m_xi2Minor >= 4; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; bool isXkbType(uint responseType) const; // https://bugs.freedesktop.org/show_bug.cgi?id=51295 protected: void initializeShm(); void initializeXFixes(); void initializeXRender(); void initializeXRandr(); void initializeXShape(); void initializeXKB(); void initializeXSync(); void initializeXInput2(); private: #if QT_CONFIG(xcb_xlib) void *m_xlibDisplay = nullptr; #endif QByteArray m_displayName; xcb_connection_t *m_xcbConnection = nullptr; int m_primaryScreenNumber = 0; const xcb_setup_t *m_setup = nullptr; QXcbAtom m_xcbAtom; bool m_hasXFixes = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; bool m_hasXkb = false; bool m_hasXRender = false; bool m_hasShm = false; bool m_hasShmFd = false; bool m_hasXSync = false; QPair m_xrenderVersion; bool m_xi2Enabled = false; int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; int m_xrandr1Minor = -1; uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; uint32_t m_xkbFirstEvent = 0; uint32_t m_maximumRequestLength = 0; }; #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ std::unique_ptr( \ call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) QT_END_NAMESPACE #endif // QXCBBASICCONNECTION_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbcursor.h000066400000000000000000000054641476226662200245360ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBCURSOR_H #define QXCBCURSOR_H #include #include "qxcbscreen.h" #include #include QT_BEGIN_NAMESPACE #ifndef QT_NO_CURSOR struct QXcbCursorCacheKey { explicit QXcbCursorCacheKey(const QCursor &c); explicit QXcbCursorCacheKey(Qt::CursorShape s) : shape(s), bitmapCacheKey(0), maskCacheKey(0) {} QXcbCursorCacheKey() : shape(Qt::CustomCursor), bitmapCacheKey(0), maskCacheKey(0) {} Qt::CursorShape shape; qint64 bitmapCacheKey; qint64 maskCacheKey; }; inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k2) { return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } inline size_t qHash(const QXcbCursorCacheKey &k, size_t seed) noexcept { return (size_t(k.shape) + size_t(k.bitmapCacheKey) + size_t(k.maskCacheKey)) ^ seed; } #endif // !QT_NO_CURSOR class QXcbCursor : public QXcbObject, public QPlatformCursor { public: QXcbCursor(QXcbConnection *conn, QXcbScreen *screen); ~QXcbCursor(); #ifndef QT_NO_CURSOR void changeCursor(QCursor *cursor, QWindow *window) override; #endif QPoint pos() const override; void setPos(const QPoint &pos) override; QSize size() const override; void updateContext(); static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr); #ifndef QT_NO_CURSOR xcb_cursor_t xcbCursor(const QCursor &c) const { return m_cursorHash.value(QXcbCursorCacheKey(c), xcb_cursor_t(0)); } #endif private: #ifndef QT_NO_CURSOR typedef QHash CursorHash; struct CachedCursor { explicit CachedCursor(xcb_connection_t *conn, xcb_cursor_t c) : cursor(c), connection(conn) {} ~CachedCursor() { xcb_free_cursor(connection, cursor); } xcb_cursor_t cursor; xcb_connection_t *connection; }; typedef QCache BitmapCursorCache; xcb_cursor_t createFontCursor(int cshape); xcb_cursor_t createBitmapCursor(QCursor *cursor); xcb_cursor_t createNonStandardCursor(int cshape); #endif QXcbScreen *m_screen; xcb_cursor_context_t *m_cursorContext; #ifndef QT_NO_CURSOR CursorHash m_cursorHash; BitmapCursorCache m_bitmapCache; #endif static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); bool m_callbackForPropertyRegistered; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbcursorfont.h000066400000000000000000000041441476226662200254170ustar00rootroot00000000000000// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // copied from #ifndef QXCBCURSORFONT_H #define QXCBCURSORFONT_H #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* QXCBCURSORFONT_H */ qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbdrag.h000066400000000000000000000120561476226662200241310ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBDRAG_H #define QXCBDRAG_H #include #include #include #include #include #include #include #include #include #include #include #include QT_REQUIRE_CONFIG(draganddrop); QT_BEGIN_NAMESPACE class QWindow; class QPlatformWindow; class QXcbConnection; class QXcbWindow; class QXcbDropData; class QXcbScreen; class QDrag; class QShapedPixmapWindow; class QXcbDrag : public QXcbObject, public QBasicDrag, public QXcbWindowEventListener { public: QXcbDrag(QXcbConnection *c); ~QXcbDrag(); bool eventFilter(QObject *o, QEvent *e) override; void startDrag() override; void cancel() override; void move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void drop(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) override; void endDrag() override; Qt::DropAction defaultAction(Qt::DropActions possibleActions, Qt::KeyboardModifiers modifiers) const override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleEnter(QPlatformWindow *window, const xcb_client_message_event_t *event, xcb_window_t proxy = 0); void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); void handleFinished(const xcb_client_message_event_t *event); bool dndEnable(QXcbWindow *win, bool on); bool ownsDragObject() const override; void updatePixmap(); xcb_timestamp_t targetTime() { return target_time; } protected: void timerEvent(QTimerEvent* e) override; bool findXdndAwareTarget(const QPoint &globalPos, xcb_window_t *target_out); private: friend class QXcbDropData; void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); Qt::DropAction toDropAction(xcb_atom_t atom) const; Qt::DropActions toDropActions(const QList &atoms) const; xcb_atom_t toXdndAction(Qt::DropAction a) const; void readActionList(); void setActionList(Qt::DropAction requestedAction, Qt::DropActions supportedActions); void startListeningForActionListChanges(); void stopListeningForActionListChanges(); QPointer initiatorWindow; QPointer currentWindow; QPoint currentPosition; QXcbDropData *m_dropData; Qt::DropAction accepted_drop_action; QWindow *desktop_proxy; xcb_atom_t xdnd_dragsource; // the types in this drop. 100 is no good, but at least it's big. enum { xdnd_max_type = 100 }; QList xdnd_types; // timestamp from XdndPosition and XdndDroptime for retrieving the data xcb_timestamp_t target_time; xcb_timestamp_t source_time; // rectangle in which the answer will be the same QRect source_sameanswer; bool waiting_for_status; // helpers for setting executed drop action outside application bool dropped; bool canceled; // A window from Unity DnD Manager, which does not respect the XDnD spec xcb_window_t xdndCollectionWindow = XCB_NONE; // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) xcb_window_t current_proxy_target; QXcbVirtualDesktop *current_virtual_desktop; // 10 minute timer used to discard old XdndDrop transactions static constexpr std::chrono::minutes XdndDropTransactionTimeout{10}; int cleanup_timer; QList drag_types; QList current_actions; QList drop_actions; struct Transaction { xcb_timestamp_t timestamp; xcb_window_t target; xcb_window_t proxy_target; QPlatformWindow *targetWindow; // QWidget *embedding_widget; QPointer drag; QTime time; }; friend class QTypeInfo; QList transactions; int transaction_expiry_timer; void restartDropExpiryTimer(); int findTransactionByWindow(xcb_window_t window); int findTransactionByTime(xcb_timestamp_t timestamp); xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows); }; Q_DECLARE_TYPEINFO(QXcbDrag::Transaction, Q_RELOCATABLE_TYPE); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbeventdispatcher.h000066400000000000000000000033571476226662200264100ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTDISPATCHER_H #define QXCBEVENTDISPATCHER_H #include #include #include #if QT_CONFIG(glib) #include #include #endif QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbUnixEventDispatcher : public QEventDispatcherUNIX { Q_OBJECT public: explicit QXcbUnixEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbUnixEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; private: QXcbConnection *m_connection; }; #if QT_CONFIG(glib) struct XcbEventSource; class QXcbGlibEventDispatcherPrivate; class QXcbGlibEventDispatcher : public QEventDispatcherGlib { Q_OBJECT Q_DECLARE_PRIVATE(QXcbGlibEventDispatcher) public: explicit QXcbGlibEventDispatcher(QXcbConnection *connection, QObject *parent = nullptr); ~QXcbGlibEventDispatcher(); bool processEvents(QEventLoop::ProcessEventsFlags flags) override; QEventLoop::ProcessEventsFlags flags() const { return m_flags; } private: XcbEventSource *m_xcbEventSource; GSourceFuncs m_xcbEventSourceFuncs; QEventLoop::ProcessEventsFlags m_flags; }; class QXcbGlibEventDispatcherPrivate : public QEventDispatcherGlibPrivate { Q_DECLARE_PUBLIC(QXcbGlibEventDispatcher) public: QXcbGlibEventDispatcherPrivate(); }; #endif // QT_CONFIG(glib) class QXcbEventDispatcher { public: static QAbstractEventDispatcher *createEventDispatcher(QXcbConnection *connection); }; QT_END_NAMESPACE #endif // QXCBEVENTDISPATCHER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbeventqueue.h000066400000000000000000000111701476226662200253760ustar00rootroot00000000000000// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEVENTQUEUE_H #define QXCBEVENTQUEUE_H #include #include #include #include #include #include #include #include #include QT_BEGIN_NAMESPACE struct QXcbEventNode { QXcbEventNode(xcb_generic_event_t *e = nullptr) : event(e) { } xcb_generic_event_t *event; QXcbEventNode *next = nullptr; bool fromHeap = false; }; class QXcbConnection; class QAbstractEventDispatcher; class QXcbEventQueue : public QThread { Q_OBJECT public: QXcbEventQueue(QXcbConnection *connection); ~QXcbEventQueue(); enum { PoolSize = 100 }; // 2.4 kB with 100 nodes enum PeekOption { // See qx11info_x11.cpp in X11 Extras module. PeekDefault = 0, // See qx11info_x11.cpp in X11 Extras module. PeekFromCachedIndex = 1, // Used by the event compression algorithms to determine if // the currently processed event (which has been already dequeued) // can be compressed. Returns from the QXcbEventQueue::peek() // on the first match. PeekRetainMatch = 2, // Marks the event in the node as "nullptr". The actual // node remains in the queue. The nodes are unlinked only // by dequeueNode(). Returns from the QXcbEventQueue::peek() // on the first match. PeekConsumeMatch = 3, // Same as above, but continues to the next node in the // queue. Repeats this until the flushed tailed node has // been reached. PeekConsumeMatchAndContinue = 4 }; Q_DECLARE_FLAGS(PeekOptions, PeekOption) void run() override; bool isEmpty() const { return m_head == m_flushedTail && !m_head->event; } xcb_generic_event_t *takeFirst(QEventLoop::ProcessEventsFlags flags); xcb_generic_event_t *takeFirst(); void flushBufferedEvents(); void wakeUpDispatcher(); // ### peek() and peekEventQueue() could be unified. Note that peekEventQueue() // is public API exposed via QX11Extras/QX11Info. PeekOption could be reworked to // have values that can be OR-ed together. template xcb_generic_event_t *peek(Peeker &&peeker) { return peek(PeekConsumeMatch, std::forward(peeker)); } template inline xcb_generic_event_t *peek(PeekOption config, Peeker &&peeker); qint32 generatePeekerId(); bool removePeekerId(qint32 peekerId); using PeekerCallback = bool (*)(xcb_generic_event_t *event, void *peekerData); bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr, PeekOptions option = PeekDefault, qint32 peekerId = -1); const QXcbEventNode *flushedTail() const { return m_flushedTail; } void waitForNewEvents(const QXcbEventNode *sinceFlushedTail, unsigned long time = (std::numeric_limits::max)()); private: QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event); void dequeueNode(); void sendCloseConnectionEvent() const; bool isCloseConnectionEvent(const xcb_generic_event_t *event); QXcbEventNode *m_head = nullptr; QXcbEventNode *m_flushedTail = nullptr; std::atomic m_tail { nullptr }; std::atomic_uint m_nodesRestored { 0 }; QXcbConnection *m_connection = nullptr; bool m_closeConnectionDetected = false; uint m_freeNodes = PoolSize; uint m_poolIndex = 0; qint32 m_peekerIdSource = 0; bool m_queueModified = false; bool m_peekerIndexCacheDirty = false; QHash m_peekerToNode; QList m_inputEvents; // debug stats quint64 m_nodesOnHeap = 0; QMutex m_newEventsMutex; QWaitCondition m_newEventsCondition; }; template xcb_generic_event_t *QXcbEventQueue::peek(PeekOption option, Peeker &&peeker) { flushBufferedEvents(); if (isEmpty()) return nullptr; QXcbEventNode *node = m_head; do { xcb_generic_event_t *event = node->event; if (event && peeker(event, event->response_type & ~0x80)) { if (option == PeekConsumeMatch || option == PeekConsumeMatchAndContinue) node->event = nullptr; if (option != PeekConsumeMatchAndContinue) return event; } if (node == m_flushedTail) break; node = node->next; } while (true); return nullptr; } QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbexport.h000066400000000000000000000006301476226662200245300ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBEXPORT_H #define QXCBEXPORT_H #include QT_BEGIN_NAMESPACE # if defined(QT_BUILD_XCB_PLUGIN) # define Q_XCB_EXPORT Q_DECL_EXPORT # else # define Q_XCB_EXPORT Q_DECL_IMPORT # endif QT_END_NAMESPACE #endif //QXCBEXPORT_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbimage.h000066400000000000000000000017131476226662200242740ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBIMAGE_H #define QXCBIMAGE_H #include "qxcbscreen.h" #include #include #include QT_BEGIN_NAMESPACE bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual, QImage::Format *imageFormat, bool *needsRgbSwap = nullptr); QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap, int width, int height, int depth, const xcb_visualtype_t *visual); xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image); xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot); QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbintegration.h000066400000000000000000000075421476226662200255430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H #include #include #include #include #include "qxcbexport.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QAbstractEventDispatcher; class QXcbNativeInterface; class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration #ifndef QT_NO_OPENGL # if QT_CONFIG(xcb_glx_plugin) , public QNativeInterface::Private::QGLXIntegration # endif # if QT_CONFIG(egl) , public QNativeInterface::Private::QEGLIntegration # endif #endif { public: QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); ~QXcbIntegration(); QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override; QPlatformWindow *createPlatformWindow(QWindow *window) const override; QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override; #ifndef QT_NO_OPENGL QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; # if QT_CONFIG(xcb_glx_plugin) QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override; # endif # if QT_CONFIG(egl) QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override; # endif #endif QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; bool hasCapability(Capability cap) const override; QAbstractEventDispatcher *createEventDispatcher() const override; void initialize() override; void moveToScreen(QWindow *window, int screen); QPlatformFontDatabase *fontDatabase() const override; QPlatformNativeInterface *nativeInterface()const override; #ifndef QT_NO_CLIPBOARD QPlatformClipboard *clipboard() const override; #endif #if QT_CONFIG(draganddrop) QPlatformDrag *drag() const override; #endif QPlatformInputContext *inputContext() const override; #if QT_CONFIG(accessibility) QPlatformAccessibility *accessibility() const override; #endif QPlatformServices *services() const override; QPlatformKeyMapper *keyMapper() const override; QStringList themeNames() const override; QPlatformTheme *createPlatformTheme(const QString &name) const override; QVariant styleHint(StyleHint hint) const override; bool hasConnection() const { return m_connection; } QXcbConnection *connection() const { return m_connection; } QByteArray wmClass() const; #if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif void sync() override; void beep() const override; bool nativePaintingEnabled() const; #if QT_CONFIG(vulkan) QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override; #endif static QXcbIntegration *instance() { return m_instance; } void setApplicationBadge(qint64 number) override; private: QXcbConnection *m_connection = nullptr; QScopedPointer m_fontDatabase; QScopedPointer m_nativeInterface; QScopedPointer m_inputContext; #if QT_CONFIG(accessibility) mutable QScopedPointer m_accessibility; #endif QScopedPointer m_services; mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; xcb_visualid_t m_defaultVisualId; static QXcbIntegration *m_instance; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbkeyboard.h000066400000000000000000000055261476226662200250200ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBKEYBOARD_H #define QXCBKEYBOARD_H #include "qxcbobject.h" #include #define explicit dont_use_cxx_explicit #include #undef explicit #include #include #include #include QT_BEGIN_NAMESPACE class QXcbKeyboard : public QXcbObject, public QPlatformKeyMapper { public: QXcbKeyboard(QXcbConnection *connection); ~QXcbKeyboard(); void initialize(); void selectEvents(); void handleKeyPressEvent(const xcb_key_press_event_t *event); void handleKeyReleaseEvent(const xcb_key_release_event_t *event); Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); void updateKeymap(); QList possibleKeyCombinations(const QKeyEvent *event) const override; Qt::KeyboardModifiers queryKeyboardModifiers() const override; void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); void updateXKBStateFromXI(void *modInfo, void *groupInfo); int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); void handleStateChanges(xkb_state_component changedComponents); protected: void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time, bool fromSendEvent); void resolveMaskConflicts(); typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); void updateVModMapping(); void updateVModToRModMapping(); private: bool m_config = false; bool m_isAutoRepeat = false; xcb_keycode_t m_autoRepeatCode = 0; struct _mod_masks { uint alt; uint altgr; uint meta; uint super; uint hyper; }; _mod_masks rmod_masks; xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; xkb_mod_index_t lock; xkb_mod_index_t control; xkb_mod_index_t mod1; xkb_mod_index_t mod2; xkb_mod_index_t mod3; xkb_mod_index_t mod4; xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; _mod_masks vmod_masks; int core_device_id; QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; QXkbCommon::ScopedXKBContext m_xkbContext; bool m_superAsMeta = false; bool m_hyperAsMeta = false; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbmime.h000066400000000000000000000023541476226662200241430ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBMIME_H #define QXCBMIME_H #include #include #include "qxcbintegration.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbMime : public QInternalMimeData { Q_OBJECT public: QXcbMime(); ~QXcbMime(); static QList mimeAtomsForFormat(QXcbConnection *connection, const QString &format); static QString mimeAtomToString(QXcbConnection *connection, xcb_atom_t a); static bool mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeData *mimeData, QByteArray *data, xcb_atom_t *atomFormat, int *dataFormat); static QVariant mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a, const QByteArray &data, const QString &format, QMetaType requestedType, bool hasUtf8); static xcb_atom_t mimeAtomForFormat(QXcbConnection *connection, const QString &format, QMetaType requestedType, const QList &atoms, bool *hasUtf8); }; QT_END_NAMESPACE #endif // QXCBMIME_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbnativeinterface.h000066400000000000000000000120101476226662200263510ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBNATIVEINTERFACE_H #define QXCBNATIVEINTERFACE_H #include #include #include #include #include "qxcbexport.h" #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbNativeInterfaceHandler; class Q_XCB_EXPORT QXcbNativeInterface : public QPlatformNativeInterface , public QNativeInterface::QX11Application { Q_OBJECT public: enum ResourceType { XDisplay, Connection, Screen, AppTime, AppUserTime, ScreenHintStyle, StartupId, TrayWindow, GetTimestamp, X11Screen, RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, AtspiBus, CompositingEnabled, VkSurface, GeneratePeekerId, RemovePeekerId, PeekEventQueue }; QXcbNativeInterface(); void *nativeResourceForIntegration(const QByteArray &resource) override; void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override; void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override; void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override; void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override; #ifndef QT_NO_CURSOR void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override; #endif NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override; NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override; NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override; NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override; NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override; QFunctionPointer platformFunction(const QByteArray &function) const override; inline const QByteArray &nativeEventType() const { return m_nativeEventType; } void *displayForWindow(QWindow *window); void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *appTime(const QXcbScreen *screen); void *appUserTime(const QXcbScreen *screen); void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); void *rootWindow(); Display *display() const override; xcb_connection_t *connection() const override; void *atspiBus(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static qint32 generatePeekerId(); static bool removePeekerId(qint32 peekerId); static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr, QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault, qint32 peekerId = -1); Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const; Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const; void addHandler(QXcbNativeInterfaceHandler *handler); void removeHandler(QXcbNativeInterfaceHandler *handler); signals: void systemTrayWindowChanged(QScreen *screen); private: const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t"); static QXcbScreen *qPlatformScreenForWindow(QWindow *window); QList m_handlers; NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const; NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const; NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const; NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const; NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const; QFunctionPointer handlerPlatformFunction(const QByteArray &function) const; void *handlerNativeResourceForIntegration(const QByteArray &resource) const; void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const; void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const; void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const; void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const; }; QT_END_NAMESPACE #endif // QXCBNATIVEINTERFACE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbobject.h000066400000000000000000000013441476226662200244600ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBOBJECT_H #define QXCBOBJECT_H #include "qxcbconnection.h" QT_BEGIN_NAMESPACE class QXcbObject { public: QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {} void setConnection(QXcbConnection *connection) { m_connection = connection; } QXcbConnection *connection() const { return m_connection; } xcb_atom_t atom(QXcbAtom::Atom atom) const { return m_connection->atom(atom); } xcb_connection_t *xcb_connection() const { return m_connection->xcb_connection(); } private: QXcbConnection *m_connection; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbscreen.h000066400000000000000000000210401476226662200244640ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCREEN_H #define QXCBSCREEN_H #include #include #include #include #include #include #include "qxcbobject.h" #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; #ifndef QT_NO_DEBUG_STREAM class QDebug; #endif class QXcbVirtualDesktop : public QXcbObject { public: QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number); ~QXcbVirtualDesktop(); xcb_screen_t *screen() const { return m_screen; } int number() const { return m_number; } QSize size() const { return QSize(m_screen->width_in_pixels, m_screen->height_in_pixels); } QSize physicalSize() const { return QSize(m_screen->width_in_millimeters, m_screen->height_in_millimeters); } QDpi dpi() const; xcb_window_t root() const { return m_screen->root; } QXcbScreen *screenAt(const QPoint &pos) const; QList screens() const { return m_screens; } void setScreens(QList &&sl) { m_screens = std::move(sl); } void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } void addScreen(QPlatformScreen *s); void setPrimaryScreen(QPlatformScreen *s); QXcbXSettings *xSettings() const; bool compositingActive() const; void updateWorkArea(); QRect availableGeometry(const QRect &screenGeometry) const; void handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event); void subscribeToXFixesSelectionNotify(); void handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event); int forcedDpi() const { return m_forcedDpi; } QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } QString windowManagerName() const { return m_windowManagerName; } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForId(xcb_visualid_t) const; quint8 depthOfVisual(xcb_visualid_t) const; xcb_colormap_t colormapForVisual(xcb_visualid_t) const; private: QRect getWorkArea() const; static bool xResource(const QByteArray &identifier, const QByteArray &expectedIdentifier, QByteArray &stringValue); void readXResources(); bool setDpiFromXSettings(const QVariant &property); xcb_screen_t *m_screen; const int m_number; QList m_screens; QXcbXSettings *m_xSettings = nullptr; xcb_atom_t m_net_wm_cm_atom = 0; bool m_compositingActive = false; QRect m_workArea; int m_forcedDpi = -1; QFontEngine::HintStyle m_hintStyle = QFontEngine::HintStyle(-1); QFontEngine::SubpixelAntialiasingType m_subpixelType = QFontEngine::SubpixelAntialiasingType(-1); int m_antialiasingEnabled = -1; QString m_windowManagerName; QMap m_visuals; QMap m_visualDepths; mutable QMap m_visualColormaps; uint16_t m_rotation = 0; friend class QXcbConnection; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen , public QNativeInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getName(xcb_randr_monitor_info_t *monitorInfo); QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; QWindow *topLevelAt(const QPoint &point) const override; QString manufacturer() const override; QString model() const override; QString serialNumber() const override; QRect geometry() const override { return m_geometry; } QRect availableGeometry() const override; int depth() const override { return screen()->root_depth; } QImage::Format format() const override; QColorSpace colorSpace() const override { return m_colorSpace; } QSizeF physicalSize() const override { return m_sizeMillimeters; } QDpi logicalDpi() const override; QDpi logicalBaseDpi() const override { return QDpi(96, 96); } QPlatformCursor *cursor() const override; qreal refreshRate() const override { return m_refreshRate; } Qt::ScreenOrientation orientation() const override { return m_orientation; } QList virtualSiblings() const override { return m_virtualDesktop->screens(); } QXcbVirtualDesktop *virtualDesktop() const { return m_virtualDesktop; } void setPrimary(bool primary) { m_primary = primary; } bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } xcb_randr_output_t output() const { return m_output; } xcb_randr_crtc_t crtc() const { return m_crtc; } xcb_randr_mode_t mode() const { return m_mode; } QList outputs() const { return m_outputs; } QList crtcs() const { return m_crtcs; } void setOutput(xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } void setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp = XCB_NONE); QString defaultName(); bool isPrimaryInXScreen(); void windowShown(QXcbWindow *window); QString windowManagerName() const { return m_virtualDesktop->windowManagerName(); } QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const; const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const { return m_virtualDesktop->visualForFormat(format); } const xcb_visualtype_t *visualForId(xcb_visualid_t visualid) const; xcb_colormap_t colormapForVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->colormapForVisual(visualid); } quint8 depthOfVisual(xcb_visualid_t visualid) const { return m_virtualDesktop->depthOfVisual(visualid); } QString name() const override { return m_outputName; } void updateGeometry(const QRect &geometry, uint8_t rotation); void updateGeometry(xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME); void updateAvailableGeometry(); void updateRefreshRate(xcb_randr_mode_t mode); QFontEngine::HintStyle hintStyle() const { return m_virtualDesktop->hintStyle(); } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_virtualDesktop->subpixelType(); } int antialiasingEnabled() const { return m_virtualDesktop->antialiasingEnabled(); } QXcbXSettings *xSettings() const; private: void sendStartupMessage(const QByteArray &message) const; int forcedDpi() const; void updateColorSpaceAndEdid(); QByteArray getOutputProperty(xcb_atom_t atom) const; QByteArray getEdid() const; QXcbVirtualDesktop *m_virtualDesktop; xcb_randr_monitor_info_t *m_monitor; xcb_randr_output_t m_output; xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; bool m_singlescreen = false; QList m_outputs; QList m_crtcs; QString m_outputName; QSizeF m_outputSizeMillimeters; QSizeF m_sizeMillimeters; QRect m_geometry; QRect m_availableGeometry; QColorSpace m_colorSpace; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; std::unique_ptr m_cursor; qreal m_refreshRate = 60.0; QEdidParser m_edid; friend class QXcbConnection; friend class QXcbVirtualDesktop; }; #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); #endif QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbscrollingdevice_p.h000066400000000000000000000034001476226662200267000ustar00rootroot00000000000000// Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSCROLLINGDEVICE_P_H #define QXCBSCROLLINGDEVICE_P_H #include QT_BEGIN_NAMESPACE class QXcbScrollingDevicePrivate : public QPointingDevicePrivate { Q_DECLARE_PUBLIC(QPointingDevice) public: QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps, int buttonCount = 3, const QString &seatName = QString()); // scrolling-related data int verticalIndex = 0; int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; Qt::Orientations orientations; Qt::Orientations legacyOrientations; mutable QPointF lastScrollPosition; // end of scrolling-related data }; class QXcbScrollingDevice : public QPointingDevice { Q_OBJECT public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, const QString &seatName = QString(), QObject *parent = nullptr) : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) { } inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q) { return static_cast(QObjectPrivate::get(q)); } }; QT_END_NAMESPACE #endif // QXCBSCROLLINGDEVICE_P_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbsessionmanager.h000066400000000000000000000026471476226662200262370ustar00rootroot00000000000000// Copyright (C) 2013 Teo Mrnjavac // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSESSIONMANAGER_H #define QXCBSESSIONMANAGER_H // // W A R N I N G // ------------- // // This file is part of the QPA API and is not meant to be used // in applications. Usage of this API may make your code // source and binary incompatible with future versions of Qt. // #include #ifndef QT_NO_SESSIONMANAGER QT_BEGIN_NAMESPACE class QEventLoop; class QXcbSessionManager : public QPlatformSessionManager { public: QXcbSessionManager(const QString &id, const QString &key); virtual ~QXcbSessionManager(); void *handle() const; void setSessionId(const QString &id) { m_sessionId = id; } void setSessionKey(const QString &key) { m_sessionKey = key; } bool allowsInteraction() override; bool allowsErrorInteraction() override; void release() override; void cancel() override; void setManagerProperty(const QString &name, const QString &value) override; void setManagerProperty(const QString &name, const QStringList &value) override; bool isPhase2() const override; void requestPhase2() override; void exitEventLoop(); private: QEventLoop *m_eventLoop; }; QT_END_NAMESPACE #endif //QT_NO_SESSIONMANAGER #endif //QXCBSESSIONMANAGER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbsystemtraytracker.h000066400000000000000000000024251476226662200270130ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBSYSTEMTRAYTRACKER_H #define QXCBSYSTEMTRAYTRACKER_H #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbConnection; class QScreen; class QXcbSystemTrayTracker : public QObject, public QXcbWindowEventListener { Q_OBJECT public: static QXcbSystemTrayTracker *create(QXcbConnection *connection); xcb_window_t trayWindow(); void requestSystemTrayWindowDock(xcb_window_t window) const; void notifyManagerClientMessageEvent(const xcb_client_message_event_t *); void handleDestroyNotifyEvent(const xcb_destroy_notify_event_t *) override; xcb_visualid_t visualId(); signals: void systemTrayWindowChanged(QScreen *screen); private: explicit QXcbSystemTrayTracker(QXcbConnection *connection, xcb_atom_t trayAtom, xcb_atom_t selection); void emitSystemTrayWindowChanged(); xcb_visualid_t netSystemTrayVisual(); const xcb_atom_t m_selection; const xcb_atom_t m_trayAtom; QXcbConnection *m_connection; xcb_window_t m_trayWindow = 0; }; QT_END_NAMESPACE #endif // QXCBSYSTEMTRAYTRACKER_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbvulkaninstance.h000066400000000000000000000021111476226662200262300ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANINSTANCE_H #define QXCBVULKANINSTANCE_H #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) #error "vulkan.h included without xcb WSI" #endif #define VK_USE_PLATFORM_XCB_KHR #include #include QT_BEGIN_NAMESPACE class QXcbWindow; class QXcbVulkanInstance : public QBasicPlatformVulkanInstance { public: QXcbVulkanInstance(QVulkanInstance *instance); ~QXcbVulkanInstance(); void createOrAdoptInstance() override; bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; void presentQueued(QWindow *window) override; VkSurfaceKHR createSurface(QXcbWindow *window); private: QVulkanInstance *m_instance; PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; PFN_vkCreateXcbSurfaceKHR m_createSurface; }; QT_END_NAMESPACE #endif // QXCBVULKANINSTANCE_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbvulkanwindow.h000066400000000000000000000011141476226662200257350ustar00rootroot00000000000000// Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBVULKANWINDOW_H #define QXCBVULKANWINDOW_H #include "qxcbwindow.h" #include "qxcbvulkaninstance.h" QT_BEGIN_NAMESPACE class QXcbVulkanWindow : public QXcbWindow { public: QXcbVulkanWindow(QWindow *window); ~QXcbVulkanWindow(); VkSurfaceKHR *surface(); protected: void resolveFormat(const QSurfaceFormat &format) override; private: VkSurfaceKHR m_surface; }; QT_END_NAMESPACE #endif // QXCBVULKANWINDOW_H qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbwindow.h000066400000000000000000000236741476226662200245330ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWINDOW_H #define QXCBWINDOW_H #include #include #include #include #include #include #include #include #include "qxcbobject.h" QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbSyncWindowRequest; class QIcon; class Q_XCB_EXPORT QXcbWindow : public QObject, public QXcbObject, public QXcbWindowEventListener, public QPlatformWindow , public QNativeInterface::Private::QXcbWindow { Q_OBJECT public: enum NetWmState { NetWmStateAbove = 0x1, NetWmStateBelow = 0x2, NetWmStateFullScreen = 0x4, NetWmStateMaximizedHorz = 0x8, NetWmStateMaximizedVert = 0x10, NetWmStateModal = 0x20, NetWmStateStaysOnTop = 0x40, NetWmStateDemandsAttention = 0x80, NetWmStateHidden = 0x100 }; Q_DECLARE_FLAGS(NetWmStates, NetWmState) enum RecreationReason { RecreationNotNeeded = 0, WindowStaysOnTopHintChanged = 0x1, WindowStaysOnBottomHintChanged = 0x2 }; Q_DECLARE_FLAGS(RecreationReasons, RecreationReason) QXcbWindow(QWindow *window); ~QXcbWindow(); void setGeometry(const QRect &rect) override; QMargins frameMargins() const override; void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; void setWindowState(Qt::WindowStates state) override; WId winId() const override; void setParent(const QPlatformWindow *window) override; bool isExposed() const override; bool isEmbedded() const override; QPoint mapToGlobal(const QPoint &pos) const override; QPoint mapFromGlobal(const QPoint &pos) const override; void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title) override; void setWindowIcon(const QIcon &icon) override; void raise() override; void lower() override; void propagateSizeHints() override; void requestActivateWindow() override; bool setKeyboardGrabEnabled(bool grab) override; bool setMouseGrabEnabled(bool grab) override; QSurfaceFormat format() const override; bool windowEvent(QEvent *event) override; bool startSystemResize(Qt::Edges edges) override; bool startSystemMove() override; void setOpacity(qreal level) override; void setMask(const QRegion ®ion) override; void setAlertState(bool enabled) override; bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } bool handleNativeEvent(xcb_generic_event_t *event) override; void handleExposeEvent(const xcb_expose_event_t *event) override; void handleClientMessageEvent(const xcb_client_message_event_t *event) override; void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; void handleButtonPressEvent(const xcb_button_press_event_t *event) override; void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source); void updateNetWmUserTime(xcb_timestamp_t timestamp); void updateWmTransientFor(); void registerWmTransientForChild(QXcbWindow *); WindowTypes wmWindowTypes() const; void setWmWindowType(WindowTypes types, Qt::WindowFlags flags); void setWindowType(WindowTypes windowTypes) override { setWmWindowType(windowTypes, window()->flags()); } void setWindowRole(const QString &role) override; void setParentRelativeBackPixmap(); bool requestSystemTrayWindowDock(); uint visualId() const override; bool needsSync() const; void postSyncWindowRequest(); void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; } QXcbScreen *xcbScreen() const; QPoint lastPointerPosition() const { return m_lastPointerPosition; } QPoint lastPointerGlobalPosition() const { return m_lastPointerGlobalPosition; } bool startSystemMoveResize(const QPoint &pos, int edges); void doStartSystemMoveResize(const QPoint &globalPos, int edges); static bool isTrayIconWindow(QWindow *window) { return window->objectName() == QLatin1StringView("QSystemTrayIconSysWindow"); } virtual void create(); virtual void destroy(); static void setWindowTitle(const QXcbConnection *conn, xcb_window_t window, const QString &title); static QString windowTitle(const QXcbConnection *conn, xcb_window_t window); int swapInterval() const { return m_swapInterval; } void setSwapInterval(int swapInterval) { m_swapInterval = swapInterval; } public Q_SLOTS: void updateSyncRequestCounter(); protected: virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; } virtual const xcb_visualtype_t *createVisual(); void setImageFormatForVisual(const xcb_visualtype_t *visual); QXcbScreen *parentScreen(); QXcbScreen *initialScreen() const; void setNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); void setNetWmState(Qt::WindowFlags flags); void setNetWmState(Qt::WindowStates state); void setNetWmStateOnUnmappedWindow(); NetWmStates netWmStates(); void setMotifWmHints(Qt::WindowFlags flags); void setTransparentForMouseEvents(bool transparent); void updateDoesNotAcceptFocus(bool doesNotAcceptFocus); void sendXEmbedMessage(xcb_window_t window, quint32 message, quint32 detail = 0, quint32 data1 = 0, quint32 data2 = 0); void handleXEmbedMessage(const xcb_client_message_event_t *event); void show(); void hide(); bool relayFocusToModalWindow() const; void doFocusIn(); void doFocusOut(); void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y, int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); void handleLeaveNotifyEvent(int root_x, int root_y, quint8 mode, quint8 detail, xcb_timestamp_t timestamp); xcb_window_t m_window = 0; uint m_depth = 0; QImage::Format m_imageFormat = QImage::Format_ARGB32_Premultiplied; bool m_imageRgbSwap = false; xcb_sync_int64_t m_syncValue; xcb_sync_counter_t m_syncCounter = 0; Qt::WindowStates m_windowState = Qt::WindowNoState; QMutex m_mappedMutex; bool m_mapped = false; bool m_transparent = false; bool m_deferredActivation = false; bool m_embedded = false; bool m_alertState = false; bool m_minimized = false; bool m_trayIconWindow = false; bool m_ignorePressedWindowOnMouseLeave = false; xcb_window_t m_netWmUserTimeWindow = XCB_NONE; QSurfaceFormat m_format; mutable bool m_dirtyFrameMargins = false; mutable QMargins m_frameMargins; QRegion m_exposeRegion; QSize m_oldWindowSize; QPoint m_lastPointerPosition; QPoint m_lastPointerGlobalPosition; xcb_visualid_t m_visualId = 0; // Last sent state. Initialized to an invalid state, on purpose. Qt::WindowStates m_lastWindowStateEvent = Qt::WindowActive; enum SyncState { NoSyncNeeded, SyncReceived, SyncAndConfigureReceived }; SyncState m_syncState = NoSyncNeeded; QXcbSyncWindowRequest *m_pendingSyncRequest = nullptr; int m_swapInterval = -1; qreal m_sizeHintsScaleFactor = 1.0; RecreationReasons m_recreationReasons = RecreationNotNeeded; QList> m_wmTransientForChildren; }; class QXcbForeignWindow : public QXcbWindow { public: QXcbForeignWindow(QWindow *window, WId nativeHandle); ~QXcbForeignWindow(); bool isForeignWindow() const override { return true; } protected: void create() override {} // No-op }; QList qRegionToXcbRectangleList(const QRegion ®ion); QT_END_NAMESPACE Q_DECLARE_METATYPE(QXcbWindow*) #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbwmsupport.h000066400000000000000000000013161476226662200252710ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBWMSUPPORT_H #define QXCBWMSUPPORT_H #include "qxcbobject.h" #include "qxcbconnection.h" #include QT_BEGIN_NAMESPACE class QXcbWMSupport : public QXcbObject { public: QXcbWMSupport(QXcbConnection *c); bool isSupportedByWM(xcb_atom_t atom) const; const QList &virtualRoots() const { return net_virtual_roots; } private: friend class QXcbConnection; void updateNetWMAtoms(); void updateVirtualRoots(); QList net_wm_atoms; QList net_virtual_roots; }; QT_END_NAMESPACE #endif qt5platform-plugins-5.7.12/xcb/libqt6xcbqpa-dev/6.8.0/qxcbxsettings.h000066400000000000000000000020501476226662200252350ustar00rootroot00000000000000// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QXCBXSETTINGS_H #define QXCBXSETTINGS_H #include "qxcbscreen.h" QT_BEGIN_NAMESPACE class QXcbXSettingsPrivate; class QXcbXSettings : public QXcbWindowEventListener { Q_DECLARE_PRIVATE(QXcbXSettings) public: QXcbXSettings(QXcbVirtualDesktop *screen); ~QXcbXSettings(); bool initialized() const; QVariant setting(const QByteArray &property) const; typedef void (*PropertyChangeFunc)(QXcbVirtualDesktop *screen, const QByteArray &name, const QVariant &property, void *handle); void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle); void removeCallbackForHandle(const QByteArray &property, void *handle); void removeCallbackForHandle(void *handle); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; private: QXcbXSettingsPrivate *d_ptr; }; QT_END_NAMESPACE #endif // QXCBXSETTINGS_H qt5platform-plugins-5.7.12/xcb/linux.cmake000066400000000000000000000054321476226662200205010ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later find_package(PkgConfig REQUIRED) pkg_check_modules( XCB REQUIRED IMPORTED_TARGET x11-xcb xi xcb-renderutil sm ice xcb-render dbus-1 xcb xcb-image xcb-icccm xcb-sync xcb-xfixes xcb-shm xcb-randr xcb-shape xcb-keysyms xcb-xkb xcb-composite xkbcommon-x11 xcb-damage xcb-xinerama mtdev egl) target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::XCB) # Don't link cairo library pkg_check_modules(CAIRO REQUIRED IMPORTED_TARGET cairo) target_include_directories(${PROJECT_NAME} PRIVATE ${CAIRO_INCLUDE_DIRS}) get_property( QT_ENABLED_PRIVATE_FEATURES TARGET Qt${QT_VERSION_MAJOR}::Gui PROPERTY QT_ENABLED_PRIVATE_FEATURES) macro(try_add_defines feature defines) list(FIND QT_ENABLED_PRIVATE_FEATURES ${feature} index) if(index GREATER 0) add_definitions(${defines}) else() message("can't find ${feature} index = ${index}") endif() endmacro() if(${QT_VERSION_MAJOR} STREQUAL "5") try_add_defines( "xcb-xlib" "-DXCB_USE_XLIB -DXCB_USE_XINPUT2 -DXCB_USE_XINPUT21 -DXCB_USE_XINPUT22") try_add_defines("xcb-sm" "-DXCB_USE_SM") try_add_defines("xcb-qt" "-DXCB_USE_RENDER") else() try_add_defines( "xcb_xlib" "-DXCB_USE_XLIB -DXCB_USE_XINPUT2 -DXCB_USE_XINPUT21 -DXCB_USE_XINPUT22") try_add_defines("xcb_sm" "-DXCB_USE_SM") try_add_defines("xcb_qt" "-DXCB_USE_RENDER") endif() list(FIND QT_ENABLED_PRIVATE_FEATURES "system-xcb" index) if(index GREATER 0) try_add_defines("xcb-render" "-DXCB_USE_RENDER") try_add_defines("xkb" "-DXCB_USE_RENDER") else() add_definitions(-DXCB_USE_RENDER) endif() if(EXISTS ${QT_XCB_PRIVATE_HEADERS}) include_directories(${QT_XCB_PRIVATE_HEADERS}) else() if(${QT_VERSION_MAJOR} STREQUAL "5") list(GET Qt5Core_INCLUDE_DIRS 0 dir) if(EXISTS ${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) include_directories(${dir}QtXcb/${Qt5_VERSION}/QtXcb/private) elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt5xcbqpa-dev/${Qt5_VERSION}) else() message(FATAL_ERROR "Not support Qt Version: ${Qt5_VERSION}") endif() elseif(${QT_VERSION_MAJOR} STREQUAL "6") if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/libqt6xcbqpa-dev/${Qt6_VERSION}) include_directories(${CMAKE_CURRENT_LIST_DIR}/libqt6xcbqpa-dev/${Qt6_VERSION}) else() message(FATAL_ERROR "Not support Qt Version: ${Qt6_VERSION}") endif() else() message(FATAL_ERROR "Not support Qt Version: ${QT_VERSION_MAJOR}") endif() endif() qt5platform-plugins-5.7.12/xcb/main.cpp000066400000000000000000000024121476226662200177630ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include #include "dplatformintegration.h" #include DPP_USE_NAMESPACE QT_BEGIN_NAMESPACE class DPlatformIntegrationPlugin : public QPlatformIntegrationPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "dpp.json") public: QPlatformIntegration *create(const QString&, const QStringList&, int &, char **) Q_DECL_OVERRIDE; }; QPlatformIntegration* DPlatformIntegrationPlugin::create(const QString& system, const QStringList& parameters, int &argc, char **argv) { #ifdef Q_OS_LINUX bool loadDXcb = false; if (qEnvironmentVariableIsSet("D_DXCB_DISABLE")) { loadDXcb = false; } else if (system == "dxcb") { loadDXcb = true; } else if (QString(qgetenv("XDG_CURRENT_DESKTOP")).toLower().startsWith("deepin") || (qgetenv("XDG_CURRENT_DESKTOP") == QByteArrayLiteral("DDE"))) { loadDXcb = true; } return loadDXcb ? new DPlatformIntegration(parameters, argc, argv) : new DPlatformIntegrationParent(parameters, argc, argv); #endif return nullptr; } QT_END_NAMESPACE #include "main.moc" qt5platform-plugins-5.7.12/xcb/utility.h000066400000000000000000000166271476226662200202240ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef UTILITY_H #define UTILITY_H #include #include #include "global.h" QT_BEGIN_NAMESPACE class QXcbWindow; QT_END_NAMESPACE typedef uint32_t xcb_atom_t; typedef struct xcb_connection_t xcb_connection_t; #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) #define D_QXCBATOM_WRAPPER(AtomEnum) Atom##AtomEnum #else #define D_QXCBATOM_WRAPPER(AtomEnum) AtomEnum #endif DPP_BEGIN_NAMESPACE class Utility { public: enum CornerEdge { TopLeftCorner = 0, TopEdge = 1, TopRightCorner = 2, RightEdge = 3, BottomRightCorner = 4, BottomEdge = 5, BottomLeftCorner = 6, LeftEdge = 7 }; static QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color); static QImage borderImage(const QPixmap &px, const QMargins &borders, const QSize &size, QImage::Format format = QImage::Format_ARGB32_Premultiplied); static QList sudokuByRect(const QRect &rect, QMargins borders); static xcb_atom_t internAtom(const char *name, bool only_if_exists = true); static xcb_atom_t internAtom(xcb_connection_t *connection, const char *name, bool only_if_exists = true); static void startWindowSystemMove(quint32 WId); static void cancelWindowMoveResize(quint32 WId); // 在触摸屏下移动窗口时,调用 startWindowSystemMove后,窗管无法grab触摸屏的touch update事件 // 导致窗口无法移动。此处跟deepin-wm配合,使用其它方式通知窗管鼠标位置更新了 // TODO: kwin适配udpate之后没有结束move状态,新增一个finished参数,当传入true时通知kwin结束 static void updateMousePointForWindowMove(quint32 WId, bool finished = false); static void showWindowSystemMenu(quint32 WId, QPoint globalPos = QPoint()); static void setFrameExtents(WId wid, const QMargins &margins); static void setShapeRectangles(quint32 WId, const QRegion ®ion, bool onlyInput = true, bool transparentInput = false); static void setShapePath(quint32 WId, const QPainterPath &path, bool onlyInput = true, bool transparentInput = false); static void startWindowSystemResize(quint32 WId, CornerEdge cornerEdge, const QPoint &globalPos = QPoint()); static bool setWindowCursor(quint32 WId, CornerEdge ce); static QRegion regionAddMargins(const QRegion ®ion, const QMargins &margins, const QPoint &offset = QPoint(0, 0)); static QByteArray windowProperty(quint32 WId, xcb_atom_t propAtom, xcb_atom_t typeAtom, quint32 len); static void setWindowProperty(quint32 WId, xcb_atom_t propAtom, xcb_atom_t typeAtom, const void *data, quint32 len, uint8_t format = 8); static void clearWindowProperty(quint32 WId, xcb_atom_t propAtom); static void setNoTitlebar(quint32 WId, bool on); static void splitWindowOnScreen(quint32 WId, quint32 type); static void splitWindowOnScreenByType(quint32 WId, quint32 position, quint32 type); static bool supportForSplittingWindow(quint32 WId); static bool supportForSplittingWindowByType(quint32 WId, quint32 screenSplittingType); struct BlurArea { qint32 x; qint32 y; qint32 width; qint32 height; qint32 xRadius; qint32 yRaduis; inline BlurArea operator *(qreal scale) { if (qFuzzyCompare(1.0, scale)) return *this; BlurArea new_area; new_area.x = qRound64(x * scale); new_area.y = qRound64(y * scale); new_area.width = qRound64(width * scale); new_area.height = qRound64(height * scale); new_area.xRadius = qRound64(xRadius * scale); new_area.yRaduis = qRound64(yRaduis * scale); return new_area; } inline BlurArea &operator *=(qreal scale) { return *this = *this * scale; } }; // by kwin static bool setEnableBlurWindow(const quint32 WId, bool enable); // by Deepin Window Manager static bool blurWindowBackground(const quint32 WId, const QVector &areas); static bool blurWindowBackgroundByPaths(const quint32 WId, const QList &paths); static bool blurWindowBackgroundByImage(const quint32 WId, const QRect &blurRect, const QImage &maskImage); static void clearWindowBlur(const quint32 WId); static bool updateBackgroundWallpaper(const quint32 WId, const QRect &area, const quint32 bMode); static void clearWindowBackground(const quint32 WId); static qint32 getWorkspaceForWindow(quint32 WId); static QVector getWindows(); static quint32 windowFromPoint(const QPoint &p); static QVector getCurrentWorkspaceWindows(); struct QtMotifWmHints { quint32 flags, functions, decorations; qint32 input_mode; quint32 status; }; static QtMotifWmHints getMotifWmHints(quint32 WId); static void setMotifWmHints(quint32 WId, QtMotifWmHints hints); static quint32 getNativeTopLevelWindow(quint32 WId); static QPoint translateCoordinates(const QPoint &pos, quint32 src, quint32 dst); static QRect windowGeometry(quint32 WId); static quint32 clientLeader(); static quint32 createGroupWindow(); static void destoryGroupWindow(quint32 groupLeader); static void setWindowGroup(quint32 window, quint32 groupLeader); #ifdef Q_OS_LINUX static int XIconifyWindow(void *display, quint32 w, int screen_number); #endif private: static void sendMoveResizeMessage(quint32 WId, uint32_t action, QPoint globalPos = QPoint(), Qt::MouseButton qbutton = Qt::LeftButton); static QWindow *getWindowById(quint32 WId); static qreal getWindowDevicePixelRatio(quint32 WId); }; DPP_END_NAMESPACE QT_BEGIN_NAMESPACE DPP_USE_NAMESPACE QDebug operator<<(QDebug deg, const Utility::BlurArea &area); inline QPainterPath operator *(const QPainterPath &path, qreal scale) { if (qFuzzyCompare(1.0, scale)) return path; QPainterPath new_path = path; for (int i = 0; i < path.elementCount(); ++i) { const QPainterPath::Element &e = path.elementAt(i); new_path.setElementPositionAt(i, qRound(e.x * scale), qRound(e.y * scale)); } return new_path; } inline QPainterPath &operator *=(QPainterPath &path, qreal scale) { if (qFuzzyCompare(1.0, scale)) return path; for (int i = 0; i < path.elementCount(); ++i) { const QPainterPath::Element &e = path.elementAt(i); path.setElementPositionAt(i, qRound(e.x * scale), qRound(e.y * scale)); } return path; } inline QRect operator *(const QRect &rect, qreal scale) { if (qFuzzyCompare(1.0, scale)) return rect; return QRect(qRound(rect.left() * scale), qRound(rect.top() * scale), qRound(rect.width() * scale), qRound(rect.height() * scale)); } inline QMargins operator -(const QRect &r1, const QRect &r2) { return QMargins(r2.left() - r1.left(), r2.top() - r1.top(), r1.right() - r2.right(), r1.bottom() - r2.bottom()); } inline QRegion operator *(const QRegion &pointRegion, qreal scale) { if (qFuzzyCompare(1.0, scale)) return pointRegion; QRegion pixelRegon; for (auto region = pointRegion.begin(); region != pointRegion.end(); ++region) { pixelRegon += (*region) * scale; } return pixelRegon; } QT_END_NAMESPACE #endif // UTILITY_H qt5platform-plugins-5.7.12/xcb/utility_x11.cpp000066400000000000000000001024251476226662200212400ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "utility.h" #include "qxcbconnection.h" #include "qxcbscreen.h" #include "dplatformintegration.h" #include "dxcbwmsupport.h" #include #include #include #include #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #else #include #endif #include #include #include #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) #include #endif #include #include #include #include #define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ #define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ #define XATOM_MOVE_RESIZE "_NET_WM_MOVERESIZE" #define XDEEPIN_BLUR_REGION "_NET_WM_DEEPIN_BLUR_REGION" #define XDEEPIN_BLUR_REGION_ROUNDED "_NET_WM_DEEPIN_BLUR_REGION_ROUNDED" #define _GTK_SHOW_WINDOW_MENU "_GTK_SHOW_WINDOW_MENU" QT_BEGIN_NAMESPACE //extern Q_WIDGETS_EXPORT void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed = 0); extern Q_WIDGETS_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0); QT_END_NAMESPACE DPP_BEGIN_NAMESPACE QImage Utility::dropShadow(const QPixmap &px, qreal radius, const QColor &color) { if (px.isNull()) return QImage(); QImage tmp(px.size() + QSize(radius * 2, radius * 2), QImage::Format_ARGB32_Premultiplied); tmp.fill(0); QPainter tmpPainter(&tmp); tmpPainter.setCompositionMode(QPainter::CompositionMode_Source); tmpPainter.drawPixmap(QPoint(radius, radius), px); tmpPainter.end(); // blur the alpha channel QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied); blurred.fill(0); QPainter blurPainter(&blurred); qt_blurImage(&blurPainter, tmp, radius, false, true); blurPainter.end(); if (color == QColor(Qt::black)) return blurred; tmp = blurred; // blacken the image... tmpPainter.begin(&tmp); tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn); tmpPainter.fillRect(tmp.rect(), color); tmpPainter.end(); return tmp; } QList Utility::sudokuByRect(const QRect &rect, QMargins borders) { QList list; // qreal border_width = borders.left() + borders.right(); // if ( border_width > rect.width()) { // borders.setLeft(borders.left() / border_width * rect.width()); // borders.setRight(rect.width() - borders.left()); // } // qreal border_height = borders.top() + borders.bottom(); // if (border_height > rect.height()) { // borders.setTop(borders.top()/ border_height * rect.height()); // borders.setBottom(rect.height() - borders.top()); // } const QRect &contentsRect = rect - borders; list << QRect(0, 0, borders.left(), borders.top()); list << QRect(list.at(0).topRight(), QSize(contentsRect.width(), borders.top())).translated(1, 0); list << QRect(list.at(1).topRight(), QSize(borders.right(), borders.top())).translated(1, 0); list << QRect(list.at(0).bottomLeft(), QSize(borders.left(), contentsRect.height())).translated(0, 1); list << contentsRect; list << QRect(contentsRect.topRight(), QSize(borders.right(), contentsRect.height())).translated(1, 0); list << QRect(list.at(3).bottomLeft(), QSize(borders.left(), borders.bottom())).translated(0, 1); list << QRect(contentsRect.bottomLeft(), QSize(contentsRect.width(), borders.bottom())).translated(0, 1); list << QRect(contentsRect.bottomRight(), QSize(borders.left(), borders.bottom())).translated(1, 1); return list; } QImage Utility::borderImage(const QPixmap &px, const QMargins &borders, const QSize &size, QImage::Format format) { QImage image(size, format); QPainter pa(&image); const QList sudoku_src = sudokuByRect(px.rect(), borders); const QList sudoku_tar = sudokuByRect(QRect(QPoint(0, 0), size), borders); pa.setCompositionMode(QPainter::CompositionMode_Source); for (int i = 0; i < 9; ++i) { pa.drawPixmap(sudoku_tar[i], px, sudoku_src[i]); } pa.end(); return image; } xcb_atom_t Utility::internAtom(xcb_connection_t *connection, const char *name, bool only_if_exists) { if (!name || *name == 0) return XCB_NONE; xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, only_if_exists, strlen(name), name); xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(connection, cookie, 0); if (!reply) return XCB_NONE; xcb_atom_t atom = reply->atom; free(reply); return atom; } xcb_atom_t Utility::internAtom(const char *name, bool only_if_exists) { return internAtom(QX11Info::connection(), name, only_if_exists); } void Utility::startWindowSystemMove(quint32 WId) { sendMoveResizeMessage(WId, _NET_WM_MOVERESIZE_MOVE); } void Utility::cancelWindowMoveResize(quint32 WId) { sendMoveResizeMessage(WId, _NET_WM_MOVERESIZE_CANCEL); } void Utility::updateMousePointForWindowMove(quint32 WId, bool finished/* = false*/) { xcb_client_message_event_t xev; const QPoint &globalPos = qApp->primaryScreen()->handle()->cursor()->pos(); xev.response_type = XCB_CLIENT_MESSAGE; xev.type = internAtom("_DEEPIN_MOVE_UPDATE"); xev.window = WId; xev.format = 32; xev.data.data32[0] = globalPos.x(); xev.data.data32[1] = globalPos.y(); // fix touch screen moving dtk window : 0 update position, 1 moving finished and clear moving state xev.data.data32[2] = finished ? 1 : 0; xev.data.data32[3] = 0; xev.data.data32[4] = 0; xcb_send_event(DPlatformIntegration::xcbConnection()->xcb_connection(), false, DPlatformIntegration::xcbConnection()->rootWindow(), XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY, (const char *)&xev); xcb_flush(DPlatformIntegration::xcbConnection()->xcb_connection()); } void Utility::showWindowSystemMenu(quint32 WId, QPoint globalPos) { if (globalPos.isNull()) { globalPos = qApp->primaryScreen()->handle()->cursor()->pos(); } xcb_client_message_event_t xev; xev.response_type = XCB_CLIENT_MESSAGE; xev.type = internAtom(_GTK_SHOW_WINDOW_MENU); xev.window = WId; xev.format = 32; xev.data.data32[1] = globalPos.x(); xev.data.data32[2] = globalPos.y(); // ungrab鼠标,防止窗管的菜单窗口无法grab鼠标 xcb_ungrab_pointer(QX11Info::connection(), XCB_CURRENT_TIME); xcb_send_event(QX11Info::connection(), false, QX11Info::appRootWindow(QX11Info::appScreen()), XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY, (const char *)&xev); xcb_flush(QX11Info::connection()); } void Utility::setFrameExtents(WId wid, const QMargins &margins) { xcb_atom_t frameExtents = internAtom("_GTK_FRAME_EXTENTS"); if (frameExtents == XCB_NONE) { qWarning() << "Failed to create atom with name _GTK_FRAME_EXTENTS"; return; } int32_t data[4]; data[0] = int32_t(margins.left()); data[1] = int32_t(margins.right()); data[2] = int32_t(margins.top()); data[3] = int32_t(margins.bottom()); xcb_change_property_checked(QX11Info::connection(), XCB_PROP_MODE_REPLACE, xcb_window_t(wid), frameExtents, XCB_ATOM_CARDINAL, 32, 4, data); } static QVector qregion2XcbRectangles(const QRegion ®ion) { QVector rectangles; rectangles.reserve(region.rectCount()); for (auto rect = region.cbegin(); rect != region.cend(); ++rect) { xcb_rectangle_t r; r.x = rect->x(); r.y = rect->y(); r.width = rect->width(); r.height = rect->height(); rectangles << r; } return rectangles; } static void setShapeRectangles(quint32 WId, const QVector &rectangles, bool onlyInput, bool transparentInput = false) { xcb_shape_mask(QX11Info::connection(), XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, WId, 0, 0, XCB_NONE); if (transparentInput) { xcb_shape_rectangles(QX11Info::connection(), XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_YX_BANDED, WId, 0, 0, 0, 0); if (onlyInput) return; } else { xcb_shape_mask(QX11Info::connection(), XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, WId, 0, 0, XCB_NONE); } if (rectangles.isEmpty()) { return; } xcb_shape_rectangles(QX11Info::connection(), XCB_SHAPE_SO_SET, onlyInput ? XCB_SHAPE_SK_INPUT : XCB_SHAPE_SK_BOUNDING, XCB_CLIP_ORDERING_YX_BANDED, WId, 0, 0, rectangles.size(), rectangles.constData()); } void Utility::setShapeRectangles(quint32 WId, const QRegion ®ion, bool onlyInput, bool transparentInput) { ::setShapeRectangles(WId, qregion2XcbRectangles(region), onlyInput, transparentInput); } void Utility::setShapePath(quint32 WId, const QPainterPath &path, bool onlyInput, bool transparentInput) { if (path.isEmpty()) { return ::setShapeRectangles(WId, QVector(), onlyInput, transparentInput); } QVector rectangles; foreach(const QPolygonF &polygon, path.toFillPolygons()) { QRegion region(polygon.toPolygon()); for (auto area = region.cbegin(); area != region.cend(); ++area) { xcb_rectangle_t rectangle; rectangle.x = area->x(); rectangle.y = area->y(); rectangle.width = area->width(); rectangle.height = area->height(); rectangles.append(std::move(rectangle)); } } ::setShapeRectangles(WId, rectangles, onlyInput, transparentInput); } void Utility::sendMoveResizeMessage(quint32 WId, uint32_t action, QPoint globalPos, Qt::MouseButton qbutton) { int xbtn = qbutton == Qt::LeftButton ? XCB_BUTTON_INDEX_1 : qbutton == Qt::RightButton ? XCB_BUTTON_INDEX_3 : XCB_BUTTON_INDEX_ANY; if (globalPos.isNull()) { globalPos = qApp->primaryScreen()->handle()->cursor()->pos(); } xcb_client_message_event_t xev; xev.response_type = XCB_CLIENT_MESSAGE; xev.type = internAtom(XATOM_MOVE_RESIZE); xev.window = WId; xev.format = 32; xev.data.data32[0] = globalPos.x(); xev.data.data32[1] = globalPos.y(); xev.data.data32[2] = action; xev.data.data32[3] = xbtn; xev.data.data32[4] = 0; if (action != _NET_WM_MOVERESIZE_CANCEL) xcb_ungrab_pointer(QX11Info::connection(), QX11Info::appTime()); xcb_send_event(QX11Info::connection(), false, QX11Info::appRootWindow(QX11Info::appScreen()), XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY, (const char *)&xev); xcb_flush(QX11Info::connection()); } QWindow *Utility::getWindowById(quint32 WId) { for (QWindow *w : qApp->allWindows()) { if (w->handle() && w->handle()->winId() == WId) { return w; } } return Q_NULLPTR; } qreal Utility::getWindowDevicePixelRatio(quint32 WId) { if (const QWindow *w = getWindowById(WId)) return w->devicePixelRatio(); return qApp->devicePixelRatio(); } void Utility::startWindowSystemResize(quint32 WId, CornerEdge cornerEdge, const QPoint &globalPos) { sendMoveResizeMessage(WId, cornerEdge, globalPos); } static xcb_cursor_t CornerEdge2Xcb_cursor_t(Utility::CornerEdge ce) { switch (ce) { case Utility::TopEdge: return XC_top_side; case Utility::TopRightCorner: return XC_top_right_corner; case Utility::RightEdge: return XC_right_side; case Utility::BottomRightCorner: return XC_bottom_right_corner; case Utility::BottomEdge: return XC_bottom_side; case Utility::BottomLeftCorner: return XC_bottom_left_corner; case Utility::LeftEdge: return XC_left_side; case Utility::TopLeftCorner: return XC_top_left_corner; default: return XCB_CURSOR_NONE; } } bool Utility::setWindowCursor(quint32 WId, Utility::CornerEdge ce) { const auto display = QX11Info::display(); Cursor cursor = XCreateFontCursor(display, CornerEdge2Xcb_cursor_t(ce)); if (!cursor) { qWarning() << "[ui]::setWindowCursor() call XCreateFontCursor() failed"; return false; } const int result = XDefineCursor(display, WId, cursor); XFlush(display); return result == Success; } QRegion Utility::regionAddMargins(const QRegion ®ion, const QMargins &margins, const QPoint &offset) { QRegion tmp; for(auto rect = region.cbegin(); rect != region.cend(); ++rect) { tmp += rect->translated(offset) + margins; } return tmp; } QByteArray Utility::windowProperty(quint32 WId, xcb_atom_t propAtom, xcb_atom_t typeAtom, quint32 len) { QByteArray data; xcb_connection_t* conn = QX11Info::connection(); xcb_get_property_cookie_t cookie = xcb_get_property(conn, false, WId, propAtom, typeAtom, 0, len); xcb_generic_error_t* err = nullptr; xcb_get_property_reply_t* reply = xcb_get_property_reply(conn, cookie, &err); if (reply != nullptr) { len = xcb_get_property_value_length(reply); const char* buf = static_cast(xcb_get_property_value(reply)); data.append(buf, len); free(reply); } if (err != nullptr) { free(err); } return data; } void Utility::setWindowProperty(quint32 WId, xcb_atom_t propAtom, xcb_atom_t typeAtom, const void *data, quint32 len, uint8_t format) { xcb_connection_t* conn = QX11Info::connection(); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, WId, propAtom, typeAtom, format, len, data); xcb_flush(conn); } void Utility::clearWindowProperty(quint32 WId, xcb_atom_t propAtom) { xcb_delete_property_checked(QX11Info::connection(), WId, propAtom); } void Utility::setNoTitlebar(quint32 WId, bool on) { quint8 value = on; setWindowProperty(WId, DXcbWMSupport::instance()->_deepin_no_titlebar, XCB_ATOM_CARDINAL, &value, 1, 8); // 默认为使用noborder属性的窗口强制打开窗口标题栏 xcb_atom_t _deepin_force_decorate = internAtom("_DEEPIN_FORCE_DECORATE", false); if (on) { quint8 value = on; setWindowProperty(WId, _deepin_force_decorate, XCB_ATOM_CARDINAL, &value, 1, 8); } else { clearWindowProperty(WId, _deepin_force_decorate); } } void Utility::splitWindowOnScreen(quint32 WId, quint32 type) { splitWindowOnScreenByType(WId, type, 1); } void Utility::splitWindowOnScreenByType(quint32 WId, quint32 position, quint32 type) { xcb_client_message_event_t xev; xev.response_type = XCB_CLIENT_MESSAGE; xev.type = internAtom("_DEEPIN_SPLIT_WINDOW", false); xev.window = WId; xev.format = 32; xev.data.data32[0] = position; /* enum class SplitType in kwin-dev, Left=0x1, Right=0x10, Top=0x100, Bottom=0x1000*/ xev.data.data32[1] = position == 15 ? 0 : 1; /* 0: not preview 1: preview*/ xev.data.data32[2] = type; /* 1:two splitting 2:three splitting 4:four splitting*/ xcb_send_event(QX11Info::connection(), false, QX11Info::appRootWindow(QX11Info::appScreen()), SubstructureNotifyMask, (const char *)&xev); xcb_flush(QX11Info::connection()); } bool Utility::supportForSplittingWindow(quint32 WId) { return Utility::supportForSplittingWindowByType(WId, 1); } // screenSplittingType: 0: can't splitting, 1:two splitting, 2: four splitting(includ three splitting) bool Utility::supportForSplittingWindowByType(quint32 WId, quint32 screenSplittingType) { auto propAtom = internAtom("_DEEPIN_NET_SUPPORTED"); QByteArray data = windowProperty(WId, propAtom, XCB_ATOM_CARDINAL, 4); if (const char *cdata = data.constData()) return *(reinterpret_cast(cdata)) >= screenSplittingType; return false; } bool Utility::setEnableBlurWindow(const quint32 WId, bool enable) { if (!DXcbWMSupport::instance()->hasBlurWindow() || !DXcbWMSupport::instance()->isKwin()) return false; xcb_atom_t atom = DXcbWMSupport::instance()->_kde_net_wm_blur_rehind_region_atom; if (atom == XCB_NONE) return false; clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask); if (enable) { quint32 value = enable; setWindowProperty(WId, atom, XCB_ATOM_CARDINAL, &value, 1, sizeof(quint32) * 8); } else { clearWindowProperty(WId, atom); } return true; } bool Utility::blurWindowBackground(const quint32 WId, const QVector &areas) { if (!DXcbWMSupport::instance()->hasBlurWindow()) return false; if (DXcbWMSupport::instance()->isDeepinWM()) { xcb_atom_t atom = DXcbWMSupport::instance()->_net_wm_deepin_blur_region_rounded_atom; if (atom == XCB_NONE) return false; if (areas.isEmpty()) { QVector areas; areas << BlurArea(); } clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask); setWindowProperty(WId, atom, XCB_ATOM_CARDINAL, areas.constData(), areas.size() * sizeof(BlurArea) / sizeof(quint32), sizeof(quint32) * 8); } else { xcb_atom_t atom = DXcbWMSupport::instance()->_kde_net_wm_blur_rehind_region_atom; if (atom == XCB_NONE) return false; QVector rects; foreach (const BlurArea &area, areas) { if (area.xRadius <= 0 || area.yRaduis <= 0) { rects << area.x << area.y << area.width << area.height; } else { QPainterPath path; path.addRoundedRect(area.x, area.y, area.width, area.height, area.xRadius, area.yRaduis); foreach(const QPolygonF &polygon, path.toFillPolygons()) { QRegion region(polygon.toPolygon()); for(auto area = region.cbegin(); area != region.cend(); ++area) { rects << area->x() << area->y() << area->width() << area->height(); } } } } clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask); if (!areas.isEmpty()) setWindowProperty(WId, atom, XCB_ATOM_CARDINAL, rects.constData(), rects.size(), sizeof(quint32) * 8); } return true; } bool Utility::blurWindowBackgroundByPaths(const quint32 WId, const QList &paths) { if (DXcbWMSupport::instance()->isDeepinWM()) { QRect boundingRect; for (const QPainterPath &p : paths) { boundingRect |= p.boundingRect().toRect(); } QImage image(boundingRect.size(), QImage::Format_Alpha8); image.fill(Qt::transparent); QPainter painter(&image); painter.setRenderHint(QPainter::Antialiasing); painter.translate(-boundingRect.topLeft()); for (const QPainterPath &p : paths) { painter.fillPath(p, Qt::black); } return blurWindowBackgroundByImage(WId, boundingRect, image); } else if (DXcbWMSupport::instance()->isKwin()) { xcb_atom_t atom = DXcbWMSupport::instance()->_kde_net_wm_blur_rehind_region_atom; if (atom == XCB_NONE) return false; if (paths.isEmpty()) { clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask); return true; } QVector rects; foreach (const QPainterPath &path, paths) { foreach(const QPolygonF &polygon, path.toFillPolygons()) { QRegion region(polygon.toPolygon()); for(auto area = region.cbegin(); area != region.cend(); ++area) { rects << area->x() << area->y() << area->width() << area->height(); } } } setWindowProperty(WId, atom, XCB_ATOM_CARDINAL, rects.constData(), rects.size(), sizeof(quint32) * 8); } return true; } bool Utility::blurWindowBackgroundByImage(const quint32 WId, const QRect &blurRect, const QImage &maskImage) { if (!DXcbWMSupport::instance()->isDeepinWM() || maskImage.format() != QImage::Format_Alpha8) return false; QByteArray array; QVector area; area.reserve(5); area << blurRect.x() << blurRect.y() << blurRect.width() << blurRect.height() << maskImage.bytesPerLine(); array.reserve(area.size() * sizeof(qint32) / sizeof(char) * area.size() + maskImage.sizeInBytes()); array.append((const char*)area.constData(), sizeof(qint32) / sizeof(char) * area.size()); array.append((const char*)maskImage.constBits(), maskImage.sizeInBytes()); clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_rounded_atom); setWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask, array.constData(), array.length(), 8); return true; } bool Utility::updateBackgroundWallpaper(const quint32 WId, const QRect &area, const quint32 bMode) { xcb_atom_t atom = DXcbWMSupport::instance()->_deepin_wallpaper; if (atom == XCB_NONE) return false; QVector rects; quint32 window_mode = (bMode & 0xffff0000) >> 16; //High 16 bits quint32 wallpaper_mode = bMode & 0x0000ffff; //low 16 bits rects << area.x() << area.y() << area.width() << area.height() << window_mode << wallpaper_mode; setWindowProperty(WId, atom, XCB_ATOM_CARDINAL, rects.constData(), rects.size(), sizeof(quint32) * 8); return true; } void Utility::clearWindowBlur(const quint32 WId) { clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_rounded_atom); clearWindowProperty(WId, DXcbWMSupport::instance()->_net_wm_deepin_blur_region_mask); clearWindowProperty(WId, DXcbWMSupport::instance()->_kde_net_wm_blur_rehind_region_atom); } void Utility::clearWindowBackground(const quint32 WId) { clearWindowProperty(WId, DXcbWMSupport::instance()->_deepin_wallpaper); } qint32 Utility::getWorkspaceForWindow(quint32 WId) { xcb_get_property_cookie_t cookie = xcb_get_property(DPlatformIntegration::xcbConnection()->xcb_connection(), false, WId, Utility::internAtom("_NET_WM_DESKTOP"), XCB_ATOM_CARDINAL, 0, 1); QScopedPointer reply( xcb_get_property_reply(DPlatformIntegration::xcbConnection()->xcb_connection(), cookie, NULL)); if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 1) { return *(qint32*)xcb_get_property_value(reply.data()); } return 0; } Utility::QtMotifWmHints Utility::getMotifWmHints(quint32 WId) { xcb_connection_t *xcb_connect = DPlatformIntegration::xcbConnection()->xcb_connection(); QtMotifWmHints hints; xcb_get_property_cookie_t get_cookie = xcb_get_property_unchecked(xcb_connect, 0, WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), 0, 20); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connect, get_cookie, NULL); if (reply && reply->format == 32 && reply->type == DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS))) { hints = *((QtMotifWmHints *)xcb_get_property_value(reply)); } else { hints.flags = 0L; hints.functions = DXcbWMSupport::MWM_FUNC_ALL; hints.decorations = DXcbWMSupport::MWM_DECOR_ALL; hints.input_mode = 0L; hints.status = 0L; } free(reply); return hints; } void Utility::setMotifWmHints(quint32 WId, Utility::QtMotifWmHints hints) { if (hints.flags != 0l) { // 如果标志为设置了xxx_all标志,则其它标志位的设置无任何意义 // 反而会导致窗管忽略xxx_all标志,因此此处重设此标志位 if (hints.functions & DXcbWMSupport::MWM_FUNC_ALL) { hints.functions = DXcbWMSupport::MWM_FUNC_ALL; } if (hints.decorations & DXcbWMSupport::MWM_DECOR_ALL) { hints.decorations = DXcbWMSupport::MWM_DECOR_ALL; } #ifdef Q_XCB_CALL2 Q_XCB_CALL2(xcb_change_property(DPlatformIntegration::xcbConnection()->xcb_connection(), XCB_PROP_MODE_REPLACE, WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), 32, 5, &hints), c); #else xcb_change_property(DPlatformIntegration::xcbConnection()->xcb_connection(), XCB_PROP_MODE_REPLACE, WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS)), 32, 5, &hints); #endif } else { #ifdef Q_XCB_CALL2 Q_XCB_CALL2(xcb_delete_property(DPlatformIntegration::xcbConnection()->xcb_connection(), WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS))), DPlatformIntegration::xcbConnection()->xcb_connection()); #else xcb_delete_property(DPlatformIntegration::xcbConnection()->xcb_connection(), WId, DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS))); #endif } } quint32 Utility::getNativeTopLevelWindow(quint32 WId) { xcb_connection_t *xcb_connection = DPlatformIntegration::xcbConnection()->xcb_connection(); do { xcb_query_tree_cookie_t cookie = xcb_query_tree_unchecked(xcb_connection, WId); QScopedPointer reply(xcb_query_tree_reply(xcb_connection, cookie, NULL)); if (reply) { if (reply->parent == reply->root) break; QtMotifWmHints hints = getMotifWmHints(reply->parent); if (hints.flags == 0) break; hints = getMotifWmHints(WId); if ((hints.decorations & DXcbWMSupport::MWM_DECOR_BORDER) == DXcbWMSupport::MWM_DECOR_BORDER) break; WId = reply->parent; } else { break; } } while (true); return WId; } QPoint Utility::translateCoordinates(const QPoint &pos, quint32 src, quint32 dst) { QPoint ret; xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(DPlatformIntegration::xcbConnection()->xcb_connection(), src, dst, pos.x(), pos.y()); xcb_translate_coordinates_reply_t *reply = xcb_translate_coordinates_reply(DPlatformIntegration::xcbConnection()->xcb_connection(), cookie, NULL); if (reply) { ret.setX(reply->dst_x); ret.setY(reply->dst_y); free(reply); } return ret; } QRect Utility::windowGeometry(quint32 WId) { xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply( DPlatformIntegration::xcbConnection()->xcb_connection(), xcb_get_geometry(DPlatformIntegration::xcbConnection()->xcb_connection(), WId), NULL); QRect rect; if (geom) { // -- // add the border_width for the window managers frame... some window managers // do not use a border_width of zero for their frames, and if we the left and // top strut, we ensure that pos() is absolutely correct. frameGeometry() // will still be incorrect though... perhaps i should have foffset as well, to // indicate the frame offset (equal to the border_width on X). // - Brad // -- copied from qwidget_x11.cpp rect = QRect(geom->x, geom->y, geom->width, geom->height); free(geom); } return rect; } quint32 Utility::clientLeader() { return DPlatformIntegration::xcbConnection()->clientLeader(); } quint32 Utility::createGroupWindow() { QXcbConnection *connection = DPlatformIntegration::xcbConnection(); uint32_t group_leader = xcb_generate_id(connection->xcb_connection()); QXcbScreen *screen = connection->primaryScreen(); xcb_create_window(connection->xcb_connection(), XCB_COPY_FROM_PARENT, group_leader, screen->root(), 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->screen()->root_visual, 0, 0); //#ifndef QT_NO_DEBUG QByteArray ba("Qt(dxcb) group leader window"); xcb_change_property(connection->xcb_connection(), XCB_PROP_MODE_REPLACE, group_leader, connection->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_NAME)), connection->atom(QXcbAtom::D_QXCBATOM_WRAPPER(UTF8_STRING)), 8, ba.length(), ba.constData()); //#endif xcb_change_property(connection->xcb_connection(), XCB_PROP_MODE_REPLACE, group_leader, connection->atom(QXcbAtom::D_QXCBATOM_WRAPPER(WM_CLIENT_LEADER)), XCB_ATOM_WINDOW, 32, 1, &group_leader); #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) // If we are session managed, inform the window manager about it QByteArray session = qGuiApp->sessionId().toLatin1(); if (!session.isEmpty()) { xcb_change_property(connection->xcb_connection(), XCB_PROP_MODE_REPLACE, group_leader, connection->atom(QXcbAtom::D_QXCBATOM_WRAPPER(SM_CLIENT_ID)), XCB_ATOM_STRING, 8, session.length(), session.constData()); } #endif // 将group leader的group leader设置为client leader setWindowGroup(group_leader, connection->clientLeader()); return group_leader; } void Utility::destoryGroupWindow(quint32 groupLeader) { xcb_destroy_window(DPlatformIntegration::xcbConnection()->xcb_connection(), groupLeader); } void Utility::setWindowGroup(quint32 window, quint32 groupLeader) { window = getNativeTopLevelWindow(window); QXcbConnection *connection = DPlatformIntegration::xcbConnection(); xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_hints_unchecked(connection->xcb_connection(), window); xcb_icccm_wm_hints_t hints; xcb_icccm_get_wm_hints_reply(connection->xcb_connection(), cookie, &hints, NULL); if (groupLeader > 0) { xcb_icccm_wm_hints_set_window_group(&hints, groupLeader); } else { hints.flags &= (~XCB_ICCCM_WM_HINT_WINDOW_GROUP); } xcb_icccm_set_wm_hints(connection->xcb_connection(), window, &hints); } int Utility::XIconifyWindow(void *display, quint32 w, int screen_number) { return ::XIconifyWindow(reinterpret_cast(display), w, screen_number); } QVector Utility::getWindows() { return DXcbWMSupport::instance()->allWindow(); } quint32 Utility::windowFromPoint(const QPoint &p) { return DXcbWMSupport::instance()->windowFromPoint(p); } QVector Utility::getCurrentWorkspaceWindows() { qint32 current_workspace = 0; xcb_get_property_cookie_t cookie = xcb_get_property(DPlatformIntegration::xcbConnection()->xcb_connection(), false, DPlatformIntegration::xcbConnection()->rootWindow(), Utility::internAtom("_NET_CURRENT_DESKTOP"), XCB_ATOM_CARDINAL, 0, 1); QScopedPointer reply( xcb_get_property_reply(DPlatformIntegration::xcbConnection()->xcb_connection(), cookie, NULL)); if (reply && reply->type == XCB_ATOM_CARDINAL && reply->format == 32 && reply->value_len == 1) { current_workspace = *(qint32*)xcb_get_property_value(reply.data()); } QVector windows; foreach (quint32 WId, getWindows()) { qint32 ws = getWorkspaceForWindow(WId); if (ws < 0 || ws == current_workspace) { windows << WId; } } return windows; } DPP_END_NAMESPACE QT_BEGIN_NAMESPACE QDebug operator<<(QDebug deg, const Utility::BlurArea &area) { QDebugStateSaver saver(deg); Q_UNUSED(saver) deg.setAutoInsertSpaces(true); deg << "x:" << area.x << "y:" << area.y << "width:" << area.width << "height:" << area.height << "xRadius:" << area.xRadius << "yRadius:" << area.yRaduis; return deg; } QT_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/windoweventhook.cpp000066400000000000000000000455761476226662200223130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2016 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later // Fix compilation issue with multi-herited QXcbWindow since 6.6.2 #include QT_BEGIN_NAMESPACE class QXcbWindow; class QPlatformWindow; inline QDebug operator<<(QDebug dbg, const QXcbWindow *window) { return dbg << (const QPlatformWindow*)(window); } QT_END_NAMESPACE #include "windoweventhook.h" #include "vtablehook.h" #include "utility.h" #include "dframewindow.h" #include "dplatformwindowhelper.h" #include "dhighdpi.h" #define private public #define protected public #include "qxcbdrag.h" #include "qxcbkeyboard.h" #undef private #undef protected #include #include #include #include #include DPP_BEGIN_NAMESPACE PUBLIC_CLASS(QXcbWindow, WindowEventHook); PUBLIC_CLASS(QDropEvent, WindowEventHook); void WindowEventHook::init(QXcbWindow *window, bool redirectContent) { const Qt::WindowType &type = window->window()->type(); if (redirectContent) { VtableHook::overrideVfptrFun(window, &QXcbWindow::handleMapNotifyEvent, &WindowEventHook::handleMapNotifyEvent); } VtableHook::overrideVfptrFun(window, &QXcbWindow::handleConfigureNotifyEvent, &WindowEventHook::handleConfigureNotifyEvent); if (type == Qt::Widget || type == Qt::Window || type == Qt::Dialog) { VtableHook::overrideVfptrFun(window, &QXcbWindow::handleClientMessageEvent, &WindowEventHook::handleClientMessageEvent); VtableHook::overrideVfptrFun(window, &QXcbWindow::handleFocusInEvent, &WindowEventHook::handleFocusInEvent); VtableHook::overrideVfptrFun(window, &QXcbWindow::handleFocusOutEvent, &WindowEventHook::handleFocusOutEvent); #ifdef XCB_USE_XINPUT22 VtableHook::overrideVfptrFun(window, &QXcbWindow::handleXIEnterLeave, &WindowEventHook::handleXIEnterLeave); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) VtableHook::overrideVfptrFun(window, &QPlatformWindow::windowEvent, &WindowEventHook::windowEvent); #else VtableHook::overrideVfptrFun(window, &QXcbWindow::windowEvent, &WindowEventHook::windowEvent); #endif } if (type == Qt::Window) { VtableHook::overrideVfptrFun(window, &QXcbWindowEventListener::handlePropertyNotifyEvent, &WindowEventHook::handlePropertyNotifyEvent); } } //#define DND_DEBUG #ifdef DND_DEBUG #define DEBUG qDebug #else #define DEBUG if(0) qDebug #endif #ifdef DND_DEBUG #define DNDDEBUG qDebug() #else #define DNDDEBUG if(0) qDebug() #endif static inline xcb_window_t xcb_window(QWindow *w) { return static_cast(w->handle())->xcb_window(); } xcb_atom_t toXdndAction(const QXcbDrag *drag, Qt::DropAction a) { switch (a) { case Qt::CopyAction: return drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionCopy)); case Qt::LinkAction: return drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionLink)); case Qt::MoveAction: case Qt::TargetMoveAction: return drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionMove)); case Qt::IgnoreAction: return XCB_NONE; default: return drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionCopy)); } } void WindowEventHook::handleConfigureNotifyEvent(QXcbWindow *window, const xcb_configure_notify_event_t *event) { DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(window); if (helper) { QWindowPrivate::get(window->window())->parentWindow = helper->m_frameWindow; } window->QXcbWindow::handleConfigureNotifyEvent(event); if (helper) { QWindowPrivate::get(window->window())->parentWindow = nullptr; if (helper->m_frameWindow->redirectContent()) helper->m_frameWindow->markXPixmapToDirty(event->width, event->height); } } void WindowEventHook::handleMapNotifyEvent(QXcbWindow *window, const xcb_map_notify_event_t *event) { window->QXcbWindow::handleMapNotifyEvent(event); if (DFrameWindow *frame = qobject_cast(window->window())) { frame->markXPixmapToDirty(); } else if (DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(window)) { helper->m_frameWindow->markXPixmapToDirty(); } } static Qt::DropAction toDropAction(QXcbConnection *c, xcb_atom_t a) { if (a == c->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionCopy)) || a == 0) return Qt::CopyAction; if (a == c->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionLink))) return Qt::LinkAction; if (a == c->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionMove))) return Qt::MoveAction; return Qt::CopyAction; } void WindowEventHook::handleClientMessageEvent(QXcbWindow *window, const xcb_client_message_event_t *event) { if (event->format != 32) { return window->QXcbWindow::handleClientMessageEvent(event); } do { if (event->type != window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndPosition)) && event->type != window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndDrop))) { break; } QXcbDrag *drag = window->connection()->drag(); // 不处理自己的drag事件 if (drag->currentDrag()) { break; } int offset = 0; int remaining = 0; xcb_connection_t *xcb_connection = window->connection()->xcb_connection(); Qt::DropActions support_actions = Qt::IgnoreAction; do { xcb_get_property_cookie_t cookie = xcb_get_property(xcb_connection, false, drag->xdnd_dragsource, window->connection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndActionList)), XCB_ATOM_ATOM, offset, 1024); xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection, cookie, NULL); if (!reply) break; remaining = 0; if (reply->type == XCB_ATOM_ATOM && reply->format == 32) { int len = xcb_get_property_value_length(reply)/sizeof(xcb_atom_t); xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply); for (int i = 0; i < len; ++i) { support_actions |= toDropAction(window->connection(), atoms[i]); } remaining = reply->bytes_after; offset += len; } free(reply); } while (remaining > 0); if (support_actions == Qt::IgnoreAction) { break; } #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) QMimeData *dropData = drag->platformDropData(); #else //FIXME(zccrs): must use the drop data object QMimeData *dropData = reinterpret_cast(drag->m_dropData); #endif if (!dropData) { return; } dropData->setProperty("_d_dxcb_support_actions", QVariant::fromValue(support_actions)); } while(0); if (event->type == window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndDrop))) { QXcbDrag *drag = window->connection()->drag(); DEBUG("xdndHandleDrop"); if (!drag->currentWindow) { drag->xdnd_dragsource = 0; return; // sanity } const uint32_t *l = event->data.data32; DEBUG("xdnd drop"); if (l[0] != drag->xdnd_dragsource) { DEBUG("xdnd drop from unexpected source (%x not %x", l[0], drag->xdnd_dragsource); return; } // update the "user time" from the timestamp in the event. if (l[2] != 0) drag->target_time = /*X11->userTime =*/ l[2]; Qt::DropActions supported_drop_actions; QMimeData *dropData = 0; if (drag->currentDrag()) { dropData = drag->currentDrag()->mimeData(); supported_drop_actions = Qt::DropActions(l[4]); } else { #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) dropData = drag->platformDropData(); #else //FIXME(zccrs): must use the drop data object dropData = reinterpret_cast(drag->m_dropData); #endif supported_drop_actions = drag->accepted_drop_action; // Drop coming from another app? Update keyboard modifiers. QGuiApplicationPrivate::modifier_buttons = QGuiApplication::queryKeyboardModifiers(); } if (!dropData) return; // ### // int at = findXdndDropTransactionByTime(target_time); // if (at != -1) // dropData = QDragManager::dragPrivate(X11->dndDropTransactions.at(at).object)->data; // if we can't find it, then use the data in the drag manager bool directSaveMode = dropData->hasFormat("XdndDirectSave0"); dropData->setProperty("IsDirectSaveMode", directSaveMode); #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) // Drop coming from another app? Update buttons. if (!drag->currentDrag()) QGuiApplicationPrivate::mouse_buttons = window->connection()->queryMouseButtons(); QPlatformDropQtResponse response = QWindowSystemInterface::handleDrop(drag->currentWindow.data(), dropData, drag->currentPosition, supported_drop_actions, QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); #else QPlatformDropQtResponse response = QWindowSystemInterface::handleDrop(drag->currentWindow.data(), dropData, drag->currentPosition, supported_drop_actions); #endif drag->setExecutedDropAction(response.acceptedAction()); if (directSaveMode) { const QUrl &url = dropData->property("DirectSaveUrl").toUrl(); if (url.isValid() && drag->xdnd_dragsource) { xcb_atom_t XdndDirectSaveAtom = Utility::internAtom("XdndDirectSave0"); xcb_atom_t textAtom = Utility::internAtom("text/plain"); QByteArray basename = Utility::windowProperty(drag->xdnd_dragsource, XdndDirectSaveAtom, textAtom, 1024); QByteArray fileUri = url.toString().toLocal8Bit() + "/" + basename; Utility::setWindowProperty(drag->xdnd_dragsource, XdndDirectSaveAtom, textAtom, fileUri.constData(), fileUri.length()); Q_UNUSED(dropData->data("XdndDirectSave0")); } } xcb_client_message_event_t finished; finished.response_type = XCB_CLIENT_MESSAGE; finished.sequence = 0; finished.window = drag->xdnd_dragsource; finished.format = 32; finished.type = drag->atom(QXcbAtom::D_QXCBATOM_WRAPPER(XdndFinished)); finished.data.data32[0] = drag->currentWindow ? xcb_window(drag->currentWindow.data()) : XCB_NONE; finished.data.data32[1] = response.isAccepted(); // flags finished.data.data32[2] = toXdndAction(drag, response.acceptedAction()); #ifdef Q_XCB_CALL Q_XCB_CALL(xcb_send_event(drag->xcb_connection(), false, drag->current_proxy_target, XCB_EVENT_MASK_NO_EVENT, (char *)&finished)); #else xcb_send_event(drag->xcb_connection(), false, drag->current_proxy_target, XCB_EVENT_MASK_NO_EVENT, (char *)&finished); #endif drag->xdnd_dragsource = 0; drag->currentWindow.clear(); drag->waiting_for_status = false; // reset drag->target_time = XCB_CURRENT_TIME; } else { window->QXcbWindow::handleClientMessageEvent(event); } } void WindowEventHook::handleFocusInEvent(QXcbWindow *window, const xcb_focus_in_event_t *event) { // Ignore focus events that are being sent only because the pointer is over // our window, even if the input focus is in a different window. if (event->detail == XCB_NOTIFY_DETAIL_POINTER) return; QWindow *w = static_cast(QObjectPrivate::get(window->window()))->eventReceiver(); if (DFrameWindow *frame = qobject_cast(w)) { if (frame->m_contentWindow) w = frame->m_contentWindow; else return; } VtableHook::callOriginalFun(window, &QXcbWindow::handleFocusInEvent, event); } void WindowEventHook::handleFocusOutEvent(QXcbWindow *window, const xcb_focus_out_event_t *event) { // Ignore focus events if (event->mode == XCB_NOTIFY_MODE_GRAB) { return; } // Ignore focus events that are being sent only because the pointer is over // our window, even if the input focus is in a different window. if (event->detail == XCB_NOTIFY_DETAIL_POINTER) return; VtableHook::callOriginalFun(window, &QXcbWindow::handleFocusOutEvent, event); } void WindowEventHook::handlePropertyNotifyEvent(QXcbWindowEventListener *el, const xcb_property_notify_event_t *event) { DQXcbWindow *window = reinterpret_cast(static_cast(el)); QWindow *ww = window->window(); window->QXcbWindow::handlePropertyNotifyEvent(event); if (event->window == window->xcb_window() && event->atom == window->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_STATE))) { QXcbWindow::NetWmStates states = window->netWmStates(); ww->setProperty(netWmStates, (int)states); if (const DFrameWindow *frame = qobject_cast(ww)) { if (frame->m_contentWindow) frame->m_contentWindow->setProperty(netWmStates, (int)states); } } } #ifdef XCB_USE_XINPUT22 static Qt::KeyboardModifiers translateModifiers(const QXcbKeyboard::_mod_masks &rmod_masks, int s) { Qt::KeyboardModifiers ret = Qt::KeyboardModifiers(); if (s & XCB_MOD_MASK_SHIFT) ret |= Qt::ShiftModifier; if (s & XCB_MOD_MASK_CONTROL) ret |= Qt::ControlModifier; if (s & rmod_masks.alt) ret |= Qt::AltModifier; if (s & rmod_masks.meta) ret |= Qt::MetaModifier; if (s & rmod_masks.altgr) ret |= Qt::GroupSwitchModifier; return ret; } static inline int fixed1616ToInt(FP1616 val) { return int((qreal(val >> 16)) + (val & 0xFFFF) / (qreal)0xFFFF); } void WindowEventHook::handleXIEnterLeave(QXcbWindow *window, xcb_ge_event_t *event) { DQXcbWindow *me = reinterpret_cast(window); xXIEnterEvent *ev = reinterpret_cast(event); // Compare the window with current mouse grabber to prevent deliver events to any other windows. // If leave event occurs and the window is under mouse - allow to deliver the leave event. QXcbWindow *mouseGrabber = me->connection()->mouseGrabber(); if (mouseGrabber && mouseGrabber != me && (ev->evtype != XI_Leave || QGuiApplicationPrivate::currentMouseWindow != me->window())) { return; } // Will send the press event repeatedly if (ev->evtype == XI_Enter && ev->mode == XCB_NOTIFY_MODE_UNGRAB) { if (ev->buttons_len > 0) { #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) Qt::MouseButtons buttons = me->connection()->buttons(); #else Qt::MouseButtons buttons = me->connection()->buttonState(); #endif const Qt::KeyboardModifiers modifiers = translateModifiers(me->connection()->keyboard()->rmod_masks, ev->mods.effective_mods); unsigned char *buttonMask = (unsigned char *) &ev[1]; for (int i = 1; i <= 15; ++i) { Qt::MouseButton b = me->connection()->translateMouseButton(i); if (b == Qt::NoButton) continue; bool isSet = XIMaskIsSet(buttonMask, i); #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) me->connection()->setButton(b, isSet); #else me->connection()->setButtonState(b, isSet); #endif const int event_x = fixed1616ToInt(ev->event_x); const int event_y = fixed1616ToInt(ev->event_y); const int root_x = fixed1616ToInt(ev->root_x); const int root_y = fixed1616ToInt(ev->root_y); if (buttons.testFlag(b)) { if (!isSet) { QGuiApplicationPrivate::lastCursorPosition = DHighDpi::fromNativePixels(QPointF(root_x, root_y), me->window()); me->handleButtonReleaseEvent(event_x, event_y, root_x, root_y, 0, modifiers, ev->time #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) , QEvent::MouseButtonRelease #endif ); } } /*else if (isSet) { QGuiApplicationPrivate::lastCursorPosition = DHighDpi::fromNativePixels(QPointF(root_x, root_y), me->window()); me->handleButtonPressEvent(event_x, event_y, root_x, root_y, 0, modifiers, ev->time #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) , QEvent::MouseButtonPress #endif ); }*/ //###(zccrs): 只设置button状态,不补发事件。防止窗口管理器(deepin-wm,kwin中无此问题)在鼠标Press期间触发此类型的事件, // 导致DTK窗口响应此点击事件后requestActive而将窗口显示到上层。此种情况发生在双击应用标题栏回复此窗口最大化状态时, // 如果此窗口下层为DTK窗口,则有可能触发此问题。 } } } me->QXcbWindow::handleXIEnterLeave(event); } #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) void WindowEventHook::windowEvent(QPlatformWindow *window, QEvent *event) #else bool WindowEventHook::windowEvent(QXcbWindow *window, QEvent *event) #endif { switch (event->type()) { case QEvent::DragEnter: case QEvent::DragMove: case QEvent::Drop: { DQDropEvent *ev = static_cast(event); Qt::DropActions support_actions = qvariant_cast(ev->mimeData()->property("_d_dxcb_support_actions")); if (support_actions != Qt::IgnoreAction) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) ev->m_actions = support_actions; #else ev->act = support_actions; #endif } } default: break; } return static_cast(window)->QXcbWindow::windowEvent(event); } #endif DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/windoweventhook.h000066400000000000000000000024121476226662200217360ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2016 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef WINDOWEVENTHOOK_H #define WINDOWEVENTHOOK_H #include "qxcbwindow.h" #include "global.h" DPP_BEGIN_NAMESPACE class WindowEventHook { public: static void init(QXcbWindow *window, bool redirectContent); static void handleConfigureNotifyEvent(QXcbWindow *window, const xcb_configure_notify_event_t *); static void handleMapNotifyEvent(QXcbWindow *window, const xcb_map_notify_event_t *); static void handleClientMessageEvent(QXcbWindow *window, const xcb_client_message_event_t *event); static void handleFocusInEvent(QXcbWindow *window, const xcb_focus_in_event_t *event); static void handleFocusOutEvent(QXcbWindow *window, const xcb_focus_out_event_t *event); static void handlePropertyNotifyEvent(QXcbWindowEventListener *el, const xcb_property_notify_event_t *event); #ifdef XCB_USE_XINPUT22 static void handleXIEnterLeave(QXcbWindow *window, xcb_ge_event_t *event); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) static void windowEvent(QPlatformWindow *window, QEvent *event); #else static bool windowEvent(QXcbWindow *window, QEvent *event); #endif }; DPP_END_NAMESPACE #endif // WINDOWEVENTHOOK_H qt5platform-plugins-5.7.12/xcb/xcb.cmake000066400000000000000000000025111476226662200201110ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: LGPL-3.0-or-later file(GLOB XCB_HEADER ${CMAKE_CURRENT_LIST_DIR}/*.h) file(GLOB XCB_SOURCE ${CMAKE_CURRENT_LIST_DIR}/*.cpp ${CMAKE_CURRENT_LIST_DIR}/3rdparty/*.c) file(GLOB XCB_RCC_QRCS ${CMAKE_CURRENT_LIST_DIR}/cursors/cursor.qrc) add_definitions(-DUSE_NEW_IMPLEMENTING) set(USE_NEW_IMPLEMENTING TRUE) if (USE_NEW_IMPLEMENTING) list(REMOVE_ITEM XCB_HEADER ${CMAKE_CURRENT_LIST_DIR}/dplatformbackingstore.h ${CMAKE_CURRENT_LIST_DIR}/dplatformwindowhook.h) list(REMOVE_ITEM XCB_SOURCE ${CMAKE_CURRENT_LIST_DIR}/dplatformbackingstore.cpp ${CMAKE_CURRENT_LIST_DIR}/dplatformwindowhook.cpp) endif() if(${QT_VERSION_MAJOR} STREQUAL "5") qt5_add_dbus_interface(DBUS_INTERFACE_XMLS ${CMAKE_SOURCE_DIR}/misc/com.deepin.im.xml im_interface) qt5_add_dbus_interface(DBUS_INTERFACE_XMLS ${CMAKE_SOURCE_DIR}/misc/org.freedesktop.DBus.xml dbus_interface) else() qt6_add_dbus_interface(DBUS_INTERFACE_XMLS ${CMAKE_SOURCE_DIR}/misc/com.deepin.im.xml im_interface) qt6_add_dbus_interface(DBUS_INTERFACE_XMLS ${CMAKE_SOURCE_DIR}/misc/org.freedesktop.DBus.xml dbus_interface) endif() set(xcb_SRC ${XCB_HEADER} ${XCB_SOURCE} ${XCB_RCC_QRCS} ${DBUS_INTERFACE_XMLS}) include_directories(${CMAKE_CURRENT_LIST_DIR}) qt5platform-plugins-5.7.12/xcb/xcbnativeeventfilter.cpp000066400000000000000000000342351476226662200233020ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #include "xcbnativeeventfilter.h" #include "utility.h" #include "dplatformwindowhelper.h" #include "dframewindow.h" #define private public #include "qxcbconnection.h" #include "qxcbclipboard.h" #undef private #include "dplatformintegration.h" #include "dxcbwmsupport.h" #include "dxcbxsettings.h" #include #include #include #include #include #include #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #define CONNECTION DPlatformIntegration::instance()->connection() #else #define CONNECTION DPlatformIntegration::instance()->defaultConnection() #endif DPP_BEGIN_NAMESPACE XcbNativeEventFilter::XcbNativeEventFilter(QXcbConnection *connection) : m_connection(connection) , lastXIEventDeviceInfo(0, XIDeviceInfos()) { // init damage first event value xcb_prefetch_extension_data(connection->xcb_connection(), &xcb_damage_id); const auto* reply = xcb_get_extension_data(connection->xcb_connection(), &xcb_damage_id); if (reply->present) { m_damageFirstEvent = reply->first_event; xcb_damage_query_version_unchecked(connection->xcb_connection(), XCB_DAMAGE_MAJOR_VERSION, XCB_DAMAGE_MINOR_VERSION); } else { m_damageFirstEvent = 0; } updateXIDeviceInfoMap(); } QClipboard::Mode XcbNativeEventFilter::clipboardModeForAtom(xcb_atom_t a) const { if (a == XCB_ATOM_PRIMARY) return QClipboard::Selection; if (a == m_connection->atom(QXcbAtom::D_QXCBATOM_WRAPPER(CLIPBOARD))) return QClipboard::Clipboard; // not supported enum value, used to detect errors return QClipboard::FindBuffer; } typedef struct qt_xcb_ge_event_t { uint8_t response_type; uint8_t extension; uint16_t sequence; uint32_t length; uint16_t event_type; } qt_xcb_ge_event_t; static inline bool isXIEvent(xcb_generic_event_t *event, int opCode) { qt_xcb_ge_event_t *e = (qt_xcb_ge_event_t *)event; return e->extension == opCode; } #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) bool XcbNativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) #else bool XcbNativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result) #endif { Q_UNUSED(eventType) Q_UNUSED(result) xcb_generic_event_t *event = reinterpret_cast(message); uint response_type = event->response_type & ~0x80; #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) if (Q_UNLIKELY(response_type == m_connection->xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY)) { #else // cannot use isXFixesType because symbols from QXcbBasicConnection are not exported if (response_type == m_connection->m_xfixesFirstEvent + XCB_XFIXES_SELECTION_NOTIFY) { #endif xcb_xfixes_selection_notify_event_t *xsn = (xcb_xfixes_selection_notify_event_t *)event; if (xsn->selection == DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_WM_CM_S0))) { DXcbWMSupport::instance()->updateHasComposite(); } QClipboard::Mode mode = clipboardModeForAtom(xsn->selection); if (mode > QClipboard::Selection) return false; // here we care only about the xfixes events that come from non Qt processes if (xsn->owner == XCB_NONE && xsn->subtype == XCB_XFIXES_SELECTION_EVENT_SET_SELECTION_OWNER) { QXcbClipboard *xcbClipboard = m_connection->m_clipboard; xcbClipboard->emitChanged(mode); } } else if (Q_UNLIKELY(response_type == m_damageFirstEvent + XCB_DAMAGE_NOTIFY)) { xcb_damage_notify_event_t *ev = (xcb_damage_notify_event_t*)event; QXcbWindow *window = m_connection->platformWindowFromId(ev->drawable); if (Q_LIKELY(window)) { DPlatformWindowHelper *helper = DPlatformWindowHelper::mapped.value(window); if (Q_LIKELY(helper)) { helper->m_frameWindow->updateFromContents(ev); } } } else { switch (response_type) { case XCB_PROPERTY_NOTIFY: { xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event; DXcbXSettings::handlePropertyNotifyEvent(pn); if (pn->atom == DPlatformIntegration::xcbConnection()->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_MOTIF_WM_HINTS))) { emit DXcbWMSupport::instance()->windowMotifWMHintsChanged(pn->window); } else if (pn->atom == DXcbWMSupport::instance()->_deepin_wallpaper_shared_key) { DXcbWMSupport::instance()->wallpaperSharedChanged(); } else { if (pn->window != CONNECTION->rootWindow()) { return false; } if (pn->atom == CONNECTION->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_SUPPORTED))) { DXcbWMSupport::instance()->updateNetWMAtoms(); } else if (pn->atom == CONNECTION->atom(QXcbAtom::D_QXCBATOM_WRAPPER(_NET_SUPPORTING_WM_CHECK))) { DXcbWMSupport::instance()->updateWMName(); } else if (pn->atom == DXcbWMSupport::instance()->_kde_net_wm_blur_rehind_region_atom) { DXcbWMSupport::instance()->updateRootWindowProperties(); } else if (pn->atom == Utility::internAtom("_NET_CLIENT_LIST_STACKING")) { emit DXcbWMSupport::instance()->windowListChanged(); } else if (pn->atom == Utility::internAtom("_NET_KDE_COMPOSITE_TOGGLING")) { DXcbWMSupport::instance()->updateWMName(); } } break; } // 修复Qt程序对触摸板的自然滚动开关后不能实时生效 // 由于在收到xi的DeviceChanged事件后,Qt更新ScrollingDevice时没有更新verticalIncrement字段 // 导致那些使用increment的正负值控制自然滚动开关的设备对Qt程序无法实时生效 // 有些电脑上触摸板没有此问题,是因为他的系统环境中没有安装xserver-xorg-input-synaptics #ifdef XCB_USE_XINPUT21 case XCB_GE_GENERIC: { QXcbConnection *xcb_connect = DPlatformIntegration::xcbConnection(); if (Q_LIKELY(xcb_connect->m_xi2Enabled) && isXIEvent(event, xcb_connect->m_xiOpCode)) { xXIGenericDeviceEvent *xiEvent = reinterpret_cast(event); { xXIDeviceEvent *xiDEvent = reinterpret_cast(event); // NOTE(zccrs): 获取设备编号,至于为何会偏移4个字节,参考: // void QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event) // xcb event structs contain stuff that wasn't on the wire, the full_sequence field // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes. // Move this data back to have the same layout in memory as it was on the wire // and allow casting, overwriting the full_sequence field. uint16_t source_id = *(&xiDEvent->sourceid + 2); auto device = xiDeviceInfoMap.find(source_id); // find device if (Q_LIKELY(device != xiDeviceInfoMap.constEnd())) { lastXIEventDeviceInfo = qMakePair(xiDEvent->time, device.value()); } } if (Q_LIKELY(xiEvent->evtype != XI_DeviceChanged)) { if (Q_UNLIKELY(xiEvent->evtype == XI_HierarchyChanged)) { xXIHierarchyEvent *xiEvent = reinterpret_cast(event); // We only care about hotplugged devices if (!(xiEvent->flags & (XISlaveRemoved | XISlaveAdded))) return false; updateXIDeviceInfoMap(); } return false; } // XIQueryDevice 在某些情况(程序放置一夜)会有一定的概率卡住,因此先禁用此逻辑,但会导致鼠标自然滚动设置无法实时生效。目前猜测可能和窗口抓取鼠标/键盘有关,被抓取设备自动休眠后再唤醒时可能会触发此问题. #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) && false xXIDeviceChangedEvent *xiDCEvent = reinterpret_cast(xiEvent); QHash::iterator device = xcb_connect->m_scrollingDevices.find(xiDCEvent->sourceid); int nrDevices = 0; XIDeviceInfo* xiDeviceInfo = XIQueryDevice(static_cast(xcb_connect->xlib_display()), xiDCEvent->sourceid, &nrDevices); if (nrDevices <= 0) { return false; } for (int c = 0; c < xiDeviceInfo->num_classes; ++c) { if (xiDeviceInfo->classes[c]->type == XIScrollClass) { XIScrollClassInfo *sci = reinterpret_cast(xiDeviceInfo->classes[c]); if (sci->scroll_type == XIScrollTypeVertical) { // device->legacyOrientations = device->orientations; // device->orientations |= Qt::Vertical; // device->verticalIndex = sci->number; device->verticalIncrement = std::signbit(sci->increment) ? -std::abs(device->verticalIncrement) : std::abs(device->verticalIncrement); } else if (sci->scroll_type == XIScrollTypeHorizontal) { // device->legacyOrientations = device->orientations; // device->orientations |= Qt::Horizontal; // device->horizontalIndex = sci->number; device->horizontalIncrement = std::signbit(sci->increment) ? -std::abs(device->horizontalIncrement) : std::abs(device->horizontalIncrement); } } } XIFreeDeviceInfo(xiDeviceInfo); #endif } break; } #endif case XCB_CLIENT_MESSAGE: { xcb_client_message_event_t *ev = reinterpret_cast(event); if (Q_UNLIKELY(DXcbXSettings::handleClientMessageEvent(ev))) { return true; } break; } default: // 过时的缩放方案, 在引入 DHighDpi 后已不再使用, 此处仅作为兼容性保障支持 static const auto updateScaleLogcailDpi = qApp->property("_d_updateScaleLogcailDpi").toULongLong(); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) if (Q_UNLIKELY(updateScaleLogcailDpi) && DPlatformIntegration::xcbConnection()->has_randr_extension && response_type == DPlatformIntegration::xcbConnection()->xrandr_first_event + XCB_RANDR_NOTIFY) { #else // cannot use isXRandrType because symbols from QXcbBasicConnection are not exported if (Q_UNLIKELY(updateScaleLogcailDpi) && DPlatformIntegration::xcbConnection()->hasXRender() && response_type == DPlatformIntegration::xcbConnection()->m_xrandrFirstEvent + XCB_RANDR_NOTIFY) { #endif xcb_randr_notify_event_t *e = reinterpret_cast(event); xcb_randr_output_change_t output = e->u.oc; if (e->subCode == XCB_RANDR_NOTIFY_OUTPUT_CHANGE) { QXcbScreen *screen = DPlatformIntegration::xcbConnection()->findScreenForOutput(output.window, output.output); if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED && output.crtc != XCB_NONE && output.mode != XCB_NONE) { DPlatformIntegration::xcbConnection()->updateScreens(e); // 通知deepin platform插件重设缩放后的dpi值 reinterpret_cast(updateScaleLogcailDpi)(); return true; } } } break; } } return false; } DeviceType XcbNativeEventFilter::xiEventSource(const QInputEvent *event) const { if (lastXIEventDeviceInfo.first == event->timestamp()) return lastXIEventDeviceInfo.second.type; return UnknowDevice; } void XcbNativeEventFilter::updateXIDeviceInfoMap() { xiDeviceInfoMap.clear(); QXcbConnection *xcb_connect = DPlatformIntegration::xcbConnection(); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) Display *xDisplay = static_cast(xcb_connect->m_xlib_display); #else Display *xDisplay = reinterpret_cast(xcb_connect->xlib_display()); #endif int deviceCount = 0; XIDeviceInfo *devices = XIQueryDevice(xDisplay, XIAllDevices, &deviceCount); for (int i = 0; i < deviceCount; ++i) { // Only non-master pointing devices are relevant here. if (devices[i].use != XISlavePointer) continue; int nprops; Atom *props = XIListProperties(xDisplay, devices[i].deviceid, &nprops); if (!nprops) return; char *name; for (int j = 0; j < nprops; ++j) { name = XGetAtomName(xDisplay, props[j]); if (QByteArrayLiteral("Synaptics Off") == name || QByteArrayLiteral("libinput Tapping Enabled") == name) { xiDeviceInfoMap[devices[i].deviceid] = XIDeviceInfos(TouchapdDevice); } else if (QByteArrayLiteral("Button Labels") == name || QByteArrayLiteral("libinput Button Scrolling Button") == name) { xiDeviceInfoMap[devices[i].deviceid] = XIDeviceInfos(MouseDevice); } XFree(name); } XFree(props); } // XIQueryDevice may return NULL..boom if (devices) XIFreeDeviceInfo(devices); } DPP_END_NAMESPACE qt5platform-plugins-5.7.12/xcb/xcbnativeeventfilter.h000066400000000000000000000024661476226662200227500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2017 - 2022 Uniontech Software Technology Co.,Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later #ifndef XCBNATIVEEVENTFILTER_H #define XCBNATIVEEVENTFILTER_H #include "global.h" #include #include #include #include QT_BEGIN_NAMESPACE class QXcbConnection; class QInputEvent; QT_END_NAMESPACE DPP_BEGIN_NAMESPACE class XcbNativeEventFilter : public QAbstractNativeEventFilter { public: struct XIDeviceInfos { XIDeviceInfos(DeviceType t = UnknowDevice): type(t) {} DeviceType type; }; XcbNativeEventFilter(QXcbConnection *connection); QClipboard::Mode clipboardModeForAtom(xcb_atom_t a) const; #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) Q_DECL_OVERRIDE; #else bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; #endif DeviceType xiEventSource(const QInputEvent *event) const; private: void updateXIDeviceInfoMap(); QXcbConnection *m_connection; uint8_t m_damageFirstEvent; QHash xiDeviceInfoMap; QPair lastXIEventDeviceInfo; }; DPP_END_NAMESPACE #endif // XCBNATIVEEVENTFILTER_H